Code:
mob/proc/Save()
if(usr.icon == null)
return
else
var/savefile/S = new("Savefiles/[src.ckey].save")
S["X"] << usr.x
S["Y"] << usr.y
S["Z"] << usr.z
S["PL"] << usr.PowerLevel
S["MPL"] << usr.maxpl
S["exp"] << usr.Exp
S["mexp"] << usr.maxexp
S["level"] << usr.level
S["zen"] << usr.money
return
mob/proc/Load()
if(fexists("Savefiles/[src.ckey].save"))
var/savefile/S = new("Savefiles/[src.ckey].save")
S["X"] >> usr.x
S["Y"] >> usr.y
S["Z"] >> usr.z
S["PL"] >>usr.PowerLevel
S["MPL"] >> usr.maxpl
S["exp"] >> usr.Exp
S["mexp"] >> usr.maxexp
S["level"] >> usr.level
S["zen"] >> usr.money
return
mob/proc/CheckSave()
if(fexists("Savefiles/[src.ckey].save"))
usr.Load()
else
usr.RaceChose()
Problem description:when i login it dosent save and i cant load
</<></<></<></<></< ></<></<></<></<>
ID:142964
Jan 23 2008, 3:41 pm
|
|
Jan 23 2008, 4:15 pm
|
|
where did u coded the auto save btw its going to be better if u make it .sav not .save also u can make ["mob"] << usr and dont have to code around 1000 vars
|
In response to Pirata Inmortal
|
|
oh so i need a autosave?
|
In response to Garthor
|
|
thats right but its not all he should code an auto save system or that wont work either o.o
|
In response to D3-Productions
|
|
That's a really silly way of saying, "Save() and Load() have to be called".
|
In response to Reuvenachi
|
|
No, but Load/Save() have to be called when the player enters and leave the game.
|
In response to Iuss
|
|
isnt that autosave? o.o
|
In response to Pirata Inmortal
|
|
...No?
Autosave is usually a proc that boots up every 20 minutes that saves everyone. Calling Save/Load means you have to use Save() and Load() whenever a player logs in, or logs out. |