[FilterScript] [FS]OnPlayerUpdate Score to Money [0.3 and 0.2X compatible]
#2

What the FUCK are you doing? are you trying to ruine or server or something?

Quote:

public OnPlayerUpdate(playerid)
{
new CashScore;
new CashScoreOld;

for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
CashScore = GetPlayerMoney(i);
SetPlayerScore(i, CashScore);
if(CashScore > CashScoreOld)
{
CashScoreOld = CashScore;
}
}
}
return 1;
}

OnPlayerUpdate get's called every like 20-30 times a second for each player.
So that like if you've 500 players (for 0.3): 500x20 = 100.000 x 500 (for the loop) = 50.000.000 times.

This function is calles 50.000.000 times each 1 second if your server is full....
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)