SA-MP Forums Archive
Anti afk - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Anti afk (/showthread.php?tid=211575)



Anti afk - Dannu13 - 15.01.2011

hy, how i can make anty afk ? when you a afk on my server 10 min you have kickid by server.. pls help


Re: Anti afk - Dannu13 - 15.01.2011

help pls


Re: Anti afk - WillyP - 15.01.2011

Search.


Re: Anti afk - XoX - 15.01.2011

Код:
forward AFK(playerid);
new timer;


public OnPlayerPause(playerid)
{
timer = SetTimerEx("AFK", 600000, 0, "i", playerid);
return 1;
}

public OnPlayerUnPause(playerid)
{
KillTimer(timer);
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 (10 Minutes)", playername);
SendClientMessageToAll(0xAFAFAFAA, string);
}
return 1;
}