Avoiding the cause of lag
#3

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;

Reply


Messages In This Thread
Avoiding the cause of lag - by vassilis - 18.02.2016, 14:49
Re: Avoiding the cause of lag - by Ilhan - 18.02.2016, 14:55
Re: Avoiding the cause of lag - by Vince - 18.02.2016, 14:57
Re: Avoiding the cause of lag - by vassilis - 18.02.2016, 15:01
Re: Avoiding the cause of lag - by mirou123 - 18.02.2016, 15:39

Forum Jump:


Users browsing this thread: 4 Guest(s)