ID:156776
 
Basically... I make constant updates for my game. I recently figured out if I reboot the server, it'll add them, but it resets all the user's variables. Is this partly because my Stats are preset? Such as 'Gold=20' when they log on, even if they bought something previously?
You need to add player saving/loading
In response to Ripiz
So, if I had a command that would save everyone in the game, would that work, or would it not affect anyone that wasn't logged in?
In response to Colin1011
It wouldn't affect them. You need to save on logout, and load on login. Check some saving demos.
In response to Ripiz
That's the case. For the Login proc: client.Load()
For the Logout proc: client.Save()
It's all there, but it still doesn't work. Here's the Saving code:
client
proc
Save()
var/savefile/F = new("[ckey].sav")
F["mob"] << mob
// Do not add anything more to be saved here
Load()
if(fexists("[ckey].sav"))
var/savefile/F = new("[ckey].sav")
F["mob"] >> mob
// Do not add anything more to be loaded here

mob
Write(var/savefile/F)
..()
// Add any special processing for saving here
F["x"] << src.x
F["y"] << src.y
F["z"] << src.z
Read(var/savefile/F)
..()
F["x"] >> src.x
F["y"] >> src.y
F["z"] >> src.z
// Add any special processing for loading here

Would that affect it in any way?
In response to Colin1011
Do you actually call save and load?
In response to Ripiz
Login/Logout script...
mob
Login()
world<<"<font color = purple>[usr.name] has logged in."
src<<"Welcome to Hogwarts: Reborn!"
src.loc=locate(3,3,1)
icon='ICONS.dmi'
src.icon_state="male"
src.frozen=0
src.mut=0
src.overlays+="hair"
var/obj/O = list("Colin1011", "Revail94", "Seteden", "LegoLover") // for every key you want to be GM place in this list
client.Load()
if(src.key in O)
src.verbs+=typesof(/mob/Admin/verb/)
src<<"You are a GM."
src.TransLevel=100
src.WPK=1
src.BCK=1
src.SSK=1
src.ShSK=1
src.WSPK=1
Logout()
world<<"<font color = purple>[src.name] has logged out."
client.Save()
del(src)