29.06.2011, 15:38
Remove all the functions from OnPlayerUpdate. Remove Timers that checks very frequently.
Create a new callback (or whatever its called lol) and use SetTimer to run the function every 5 seconds.
Create a new callback (or whatever its called lol) and use SetTimer to run the function every 5 seconds.
pawn Код:
new FiveSecTimer; //On top of your script.
FiveSecTimer = SetTimer("FiveSecCheck", 5000, true); // in OnGameModeInit
KillTimer(FiveSecTimer); // in OnGameModeExit
forward FiveSecCheck();
public FiveSecCheck()
{
//All your checks here, for playerid checks, make a loop.
return 1;
}