Quote:
Originally Posted by Conroy
OnPlayerUpdate isn't called.
Find out how many times OnPlayerUpdate is called (32 per second approx.), then create a timer to zero a variable which is increased everytime OnPlayerUpdate is called.
Ex:
pawn Code:
forward CheckForPause();
new PlayerUpdateCount[MAX_PLAYERS]; new PlayerPaused[MAX_PLAYERS];
//OnGameModeInit SetTimer("CheckForPause", 1000, true);
//OnPlayerUpdate PlayerUpdateCount[playerid] += 0.03125 //Because 0.03125 * the amount of times OnPlayerUpdate is called (32) equals 1
public CheckForPause() { for(new i; i <= MAX_PLAYERS; i++) { if(IsPlayerConnected(i) && !PlayerPaused[i]) { PlayerUpdateCount[i]--; if(PlayerUpdateCount[i] < 0) PlayerPaused[i] = 1; } } return 1; }
|
Why this doesn't work for me?