Avoiding the cause of lag
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
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;

My script is saving player position so he gets spawned at the last position he was before death.
Any method to change the way i am working it ?
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: 5 Guest(s)