SA-MP Forums Archive
Timer problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Timer problem (/showthread.php?tid=327049)



Timer problem (FIXED) - ryansheilds - 19.03.2012

FIXED! - I rewrote the code.


Re: Timer problem - Unte99 - 19.03.2012

Important Note: The function that should be called, must be public, meaning it has to be forwarded.


Re: Timer problem - ryansheilds - 19.03.2012

Changed it to a public but still doesn't save them.


Re: Timer problem - T0pAz - 19.03.2012

You really don't need to save it frequently. Only save data when player disconnects which occurs on OnPlayerDisconnect callback.


Re: Timer problem - ryansheilds - 19.03.2012

It saves OnPlayerDisconnect, but if the server crashes or some kind of problem occurs that causes OnPlayerDisconnect not to be called all the player stats will be lost - although the timer doesn't necessarily need to be every 13 seconds.


Re: Timer problem - new121 - 19.03.2012

pawn Код:
forward SaveAccounts();
public SaveAccounts()
{
    foreach(Player, i)
    {
        if(Logged[i] == 1)
        {
            SaveAccountStats(i);
        }
    }
}
Try that