Ко всем нью:
Code
new Float:AntiAFK[MAX_PLAYERS][6];
new PlayerAFKtime[MAX_PLAYERS];
В OnPlayerConnect:
Code
PlayerAFKtime[playerid] = 0;
В SetPlayerUnjail:
Code
GetPlayerPos(i,AntiAFK[i][3],AntiAFK[i][4],AntiAFK[i][5]);
if(AntiAFK[i][0] == AntiAFK[i][3] && AntiAFK[i][1] == AntiAFK[i][4] && AntiAFK[i][2] == AntiAFK[i][5])
{
PlayerAFKtime[i] ++;
if(PlayerAFKtime[i] == 900)
{
GetPlayerName(i,sendername,sizeof(sendername));
format(string,sizeof(string)," %s был кикнут за АФК", sendername);
SendClientMessageToAll(COLOR_LIGHTRED,string);
Kick(i);
}
}
else
{
PlayerAFKtime[i] = 0;
AntiAFK[i][0] = AntiAFK[i][3];
AntiAFK[i][1] = AntiAFK[i][4];
AntiAFK[i][2] = AntiAFK[i][5];
}