ID:159501
 
How do i make a save where it will save Everybody who is currently onlines Data
proc
Save()
for(var/mob/M in world)
M.Save()
mob
proc/Save()
var/savefile/F = new("players\ [src.ckey].sav")
Write(F)
In response to Choka
It would be a good idea to have the procedure names differ from each other, don't want to accidentally called Save() when you wanted just mob.Save()

The way I would do it would be to loop through the clients and save their mobs; tiny bit more efficient (and less typing) but probably the difference is insignificant
proc/Save_All()
for(var/client/C)
if(C.mob) C.mob.Save()


To make an auto-global save, spawn an infinite loop function (with a sleep delay!) which will save all mobs:
world/New()
..()
SpAwN(time)
Autosave()

proc/Autosave()
for() // infinite loop, or you can do while(1)... meh
sleep(X)
Save_All_Mobs
In response to GhostAnime
What's up with the spawn()...?
In response to Choka
Anti-Copying Mechanism.