01.11.2012, 16:37
Or you could created a new variable for each player, adding a timer each second which increases the variable, and set the variable back to 0 OnPlayerUpdate - Since OnPlayerUpdate is not called when a players paused.
I literally coded that in the reply message... Improve it as you wish.
pawn Code:
new iPlayerPaused[MAX_PLAYERS];
OnPlayerConnect(playerid) {
iPlayerPaused[playerid] = 0;
}
OnPlayerUpdate(playerid) {
iPlayerPaused[playerid] = 0;
}
forward PausedCheck(); public PausedCheck() { // Set timer each second
for(new i = 0; i < MAX_PLAYERS; i++) {
iPlayerPaused[i] += 1;
if(iPlayerPaused[i] > 2) {
// Players most likely Paused.
}
}
}