02.01.2011, 09:48
I want to make if somebody Isnt moving for 5 minits then he gets kicked no idea how can anybody help me?
forward AFK(playerid);
new AFKtimer;
public OnPlayerPause(playerid)
{
AFKtimer = SetTimerEx("AFK", 300000, 0, "i", playerid);
return 1;
}
public OnPlayerUnPause(playerid)
{
KillTimer(AFKtimer);
return 1;
}
public AFK(playerid)
{
if(IsPlayerPaused(playerid))
{
Kick(playerid);
new string[128], playername[24];
GetPlayerName(playerid, playername, 24);
format(string, sizeof(string), "%s has been kicked for being AFK (away from keyboard) for more than 5 minutes", playername);
SendClientMessageToAll(0xAFAFAFAA, string);
}
return 1;
}