Stats not saving after server restart
#3

Create a timer that saves the player's statistics every 30 seconds:

pawn Код:
public OnFilterScriptInit() //Or OnGameModeInit
{
    SetTimer("SaveAll", 30000, 1);
    return 1;
}
pawn Код:
forward SaveAll();
public SaveAll()
{
    for(new i=0; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i) && !IsPlayerNPC(i)) SavePlayerStats(i);
    return 1;
}
Then they will lose max. 30 seconds of their statistics, that's also a great feature in case your server crashes.
Before you make a restart, create a command which calls SaveAll(); again.
Reply


Messages In This Thread
Stats not saving after server restart - by kbalor - 12.09.2012, 11:45
Re: Stats not saving after server restart - by Roko_foko - 12.09.2012, 11:52
Re: Stats not saving after server restart - by Jeffry - 12.09.2012, 11:52
Re : Stats not saving after server restart - by Miro96 - 04.07.2013, 16:21
Re: Stats not saving after server restart - by ReVo_ - 04.07.2013, 16:24

Forum Jump:


Users browsing this thread: 1 Guest(s)