ID:140895
 
Code:
mob/var
Exists=0

client
proc
Save()
if(!src)return
if(!src.mob)return
var/savefile/save
save = new ("Player Saves/[mob.ckey].sav")
save["mob"] << src.mob
save["x"] << src.mob.x
save["y"] << src.mob.y
save["z"] << src.mob.z
Load()
var/savefile/load
load = new ("Player Saves/[mob.ckey].sav")
load["mob"] >> src.mob
load["x"] >> src.mob.x
load["y"] >> src.mob.y
load["z"] >> src.mob.z


Problem description:It saves,and loads...but it never places me to the place where I saved.(it just gives me the black screen when i load but if I teleport somewhere it will be ok.)

You can't just load straight into the x,y,z variables. You have to use locate().

Also, that should be going into mob/Write() and Read(), which will be called when you do save << mob:

mob/Write(var/savefile/F)
..()
F["x"] << x
F["y"] << y
F["z"] << z

mob/Read(var/savefile/F)
..()
loc = locate(F["x"], F["y"], F["z"])
In response to Garthor
Ok thx,it works....but i just edited mine....since somehow using write/read doesn't work for me xD
In response to Destrojer
There's no reason it shouldn't be working and you really should use them.

Oh, and I just noticed: if(!src) is almost completely meaningless. You really don't need that line.
In response to Garthor
Garthor wrote:
Oh, and I just noticed: if(!src) is almost completely meaningless. You really don't need that line.

The reason he says this is because if an atom is deleted then any procs running on it are immediately halted. Checking if(somevariable) is real isn't always a bad thing, just unnecessary in this case.