ID:145060
 
Code:
        Reboot()
set category = "Admin"
switch(alert("Are you sure?","Reboot","Yes","No"))
if("Yes")
world << "<center><b>WORLD IS REBOOTING IN 5 SECONDS..."
sleep(50)
world.Reboot()


Logout()
usr.Save()
world << "<b> \blue [usr] logs out!"
sleep(20)
del(src)


Problem description:
After a reboot, everyonce and awhile, someone cannot log back in and has to manually, or their save is killed >_>, its happened to me once, and a GM of mine, and countless players. I put the reboot and the logout, i think maybe that its saving, and not having enough time before the reboot kicks in. How would i fix this, or the problems really going on.
I would suggest before the reboot, have it detect all players mobs in the game and save it instead of relying on /mob/Logout() to do all the work. this would require the use of for().
In response to Crzylme
Crzylme wrote:
I would suggest before the reboot, have it detect all players mobs in the game and save it instead of relying on /mob/Logout() to do all the work. this would require the use of for().

due to that fact this is my first game, i have no clue how to do that.
Soccerguy13 wrote:
for(var/mob/M in world)
M.Save()

just stick it in before the reboot.

thank u got it to work
In response to FriesOfDoom
You probably should spawn() it.
In response to Justin B
Justin B wrote:
You probably should spawn() it.

And make sure the mob is a client.