ID:143340
 
Code:
i cant load my player why??
mob
proc
LoadPlayer()
if(fexists("players/[src.key].sav"))
var/savefile/F = new("players/[src.key].sav")
F["mob"] >> usr
F["x"] >> usr.x
F["y"] >> usr.y
F["z"] >> usr.z
F["maxki"] >> usr.Mchakra
F["zenni"] >> usr.Yen
F["health"] >> usr.maxhealth
F["Guild"] >> usr.squad
F["Level"] >> usr.level
F["Mexp"] >> usr.mexp
F["exp"] >> usr.exp
usr.chakra = usr.Mchakra
usr.stamina = 100
usr.health = usr.maxhealth
Read(F)
world<<"<font size=1><font color=yellow><B>Info:<font color = FFCC33> [usr] has logged on the server."
return
else
usr<<"<b>I guess you need to have a character to load it"
return

mob
proc
saveproc()
if(src.cansave)
var/savefile/F = new("players/[usr.key].sav")
F["mob"] << src
F["x"] << src.x
F["y"] << src.y
F["z"] << src.z
F["maxki"] << src.Mchakra
F["zenni"] << src.Yen
F["health"] << src.maxhealth
F["Guild"] << src.squad
F["Level"] << src.level
F["Mexp"] << src.mexp
F["exp"] << src.exp
Write(F)


Problem description:

why?? whats wrong??
It's because you're using usr in a proc where it shouldn't be used! (Unless it's a single player game only >_>)

Oh and you can't directly load x/y/z in to the variables, you must first set it in to a locally defined variable and then set x/y/z to it.

And it does help knowing what _exactly_ doesn't work.
In response to GhostAnime
GhostAnime wrote:
Oh and you can't directly load x/y/z in to the variables, you must first set it in to a locally defined variable and then set x/y/z to it.

Technically, yes you can, although its recommended not to.
In response to Jamesburrow
Though it's a little different, it's because you ought to set the location rather than the coordinates for more robust, safer operations, checking if such coordinates are valid in the process. And to do that you have to keep the coordinates in local vars first, of course, to be used with locate(), for example.