01.02.2013, 09:26
Quote:
|
Yeah, the best bet would be to check the TickCount on every PlayerUpdate.
|
).And in fact the method that tyler posted does work, but not the best. What I've considered to be the best solution so far is have a variable that is incremented in a timer and set to zero in OnPlayerUpdate.
pawn Код:
new NoUpdateFor[MAX_PLAYERS];
// OnGameModeInit()
SetTimer("IncrementAFK", 1000, true);
// IncrementAFK()
foreach(Player, i)
{
NoUpdateFor[i] ++;
}
// OnPlayerUpdate(playerid)
NoUpdateFor[i] = 0;
// IsPlayerNotSendingUpdates(playerid)
return (NoUpdateFor[playerid] > 3);


