SA-MP Forums Archive
OnPlayerUpdate question - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: OnPlayerUpdate question (/showthread.php?tid=138480)



OnPlayerUpdate question - Nakash - 02.04.2010

Hello. I am using a Godfather edit and I saw that it has the OnPlayerUpdate callback. now I heard that it is not good to save files in OnPlayerUpdate because it gets called too much times per second, so if I create a new callback called UpdatePlayer(playerid) it will be better? Of course I will change all the OnPlayerUpdate(playerid); to UpdatePlayer(playerid);

I have another question now, when I changed the name, should I add a timer somewhere? if yes, where?


Re: OnPlayerUpdate question - MadeMan - 02.04.2010

You don't need to add a timer. Just replace the name.


Re: OnPlayerUpdate question - DeDiHosting - 02.04.2010

but you should add a timer, maybee 10minutes, and set it to onplayerdisconnect, too


Re: OnPlayerUpdate question - MadeMan - 02.04.2010

Quote:
Originally Posted by DeDiHosting
but you should add a timer, maybee 10minutes, and set it to onplayerdisconnect, too
If he has a Godfather edit, he already has it.


Re: OnPlayerUpdate question - Nakash - 02.04.2010

Thank you guys, I changed it now.
Does it really change something ?


Re: OnPlayerUpdate question - Jakku - 02.04.2010

pawn Код:
forward SavePlayerStats();

SetTimer("SavePlayerStats",5000,1);

public SavePlayerStats()
{
for (new i = 0; i < MAX_PLAYERS; i++)
{
// Things you want to save here
}

}