ID:145106
 
Code:
client
proc
Load()
var/firstletter=copytext(usr.ckey, 1, 2)
if(usr == usr)
var/savefile/load
load = new ("players/[firstletter]/[src.ckey].sav")
load["mob"] >> src.mob
load["x"] >> src.mob.x
load["y"] >> src.mob.y
load["z"] >> src.mob.z




Save()
var/firstletter=copytext(usr.ckey, 1, 2)
if(usr == usr)
var/savefile/save
save = new ("players/[firstletter]/[src.ckey].sav")
save["mob"] << src.mob
save["x"] << src.mob.x
save["y"] << src.mob.y
save["z"] << src.mob.z


Problem description:Every time I call the Load() proc it loads,then does the Login() proc again.

You need to check wether the player HAS a save file. Otherwise it'll load blank. Look up fexists()
In response to Mysame (#1)
Yeah it exists and it loads the players spot but then it calls the Login() again
In response to Metamorphman (#2)
Plz help me out wit this
In response to Metamorphman (#3)
I don't know what the problem is, but here is a copy of my Save file, it works fine, if you want to use that

<dm>
mob
proc
Save()
var/savefile/F=new("./Save Files/[src.ckey].sav")
src.Write(F)
F["lastx"] << src.x
F["lasty"] << src.y
F["lastz"] << src.z
Load()
var/savefile/F=new("./Save Files/[src.ckey].sav")
src.Read(F)
var/newX
var/newY
var/newZ
F["lastx"] >> newX
F["lasty"] >> newY
F["lastz"] >> newZ
src.loc=locate(newX,newY,newZ)
Any time a client connects to a new mob is calls the Login() proc.
In response to Justin Knight (#5)
and what can I do to stop that from happening?
In response to Metamorphman (#6)
I'd say, instead of Read(), load the mob from the savefile.
In response to Mysame (#7)
How do I do that?