15.01.2014, 20:09
OnPlayerUpdate is not calling while player is paused, it is being called whenever player updates server with his status (Pos,Weapon,Skin etc.)
So you can do this:
P.S. sorry I don't have any other idea. xD
So you can do this:
pawn Код:
#define MAX_AFK_MINUTES 10
public OnPlayerUpdate(playerid)
{
SetPVarInt(playerid, "AFK", 0);
SetPVarInt(playerid, "AFKMinutes", 0);
return 1;
}
forward AddAfk();
public AddAfk()
{
foreach(Player, playerid)
{
SetPVarInt(playerid, "AFK", 1);
SetPVarInt(playerid, "AFKMinutes", GetPVarInt(playerid, "AFKMinutes")+1);
if(GetPVarInt(playerid, "AFKMinutes") > MAX_AFK_MINUTES)
{
Kick(playerid);
}
}
return 1;
}
public OnGameModeInit()
{
SetTimer("AddAfk", 1000*60, true);
return 1;
}