18.02.2016, 14:57
None. Update immediately as and when it is needed. There are certain exceptions, such as stuff that gets updated very frequently (distance traveled and such) which can be saved every n calls to the function, e.g.:
PHP код:
public OnPlayerUpdate()
{
static updateCount[MAX_PLAYERS];
if(++updateCount[playerid] > 1000)
{
SaveTheStuff(playerid);
updateCount[playerid] = 0;
}
PlayerInfo[playerid][pDistance] += GetDistanceTravelled(...);
// ...
return 1;
}