29.06.2018, 21:10
PHP код:
static
playerLastUpdate[MAX_PLAYERS];
#define IsPlayerPaused(%0,%1) \
(GetTickCount() > (playerLastUpdate[%0] + %1))
public OnPlayerConnect(playerid)
{
SetTimerEx("Update", 1000, true, "i", playerid);
return 1;
}
public OnPlayerUpdate(playerid)
{
playerLastUpdate[playerid] = GetTickCount();
return 1;
}
forward Update(playerid);
public Update(playerid)
{
if (IsPlayerPaused(playerid, 300000)) // 5 minutos
{
Kick(playerid);
}
}