16.01.2013, 12:53
pawn Code:
public OnPlayerSpawn(playerid)
{
SetTimerEx("AFKCheck", 300000, false, "i", playerid);
return 1;
}
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
KillTimer(AFKCheck(playerid));
SetTimerEx("AFKCheck", 300000, false, "i", playerid);
return 1;
}
public OnPlayerText(playerid, text[])
{
KillTimer(AFKCheck(playerid));
SetTimerEx("AFKCheck", 300000, false, "i", playerid);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
KillTimer(AFKCheck(playerid));
SetTimerEx("AFKCheck", 300000, false, "i", playerid);
return 1;
}
forward AFKCheck(playerid);
public AFKCheck(playerid)
{
new string[80];
format(string, sizeof(string), "Player %s has been kicked | Reason: Away From Keyboard", playername);
SendClientMessageToAll(0xFF0000FF, string);
Kick(playerid);
return 1;
}