SA-MP Forums Archive
5 mins not moving -> afk -> kick ? - 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: 5 mins not moving -> afk -> kick ? (/showthread.php?tid=205772)



5 mins not moving -> afk -> kick ? - thimo - 02.01.2011

I want to make if somebody Isnt moving for 5 minits then he gets kicked no idea how can anybody help me?


Re: 5 mins not moving -> afk -> kick ? - Jay. - 02.01.2011

Try this http://forum.sa-mp.com/showthread.ph...ct+afk+include


Re: 5 mins not moving -> afk -> kick ? - TouR - 02.01.2011

I would use the cordinates... Like use a timer to detect if someone coordinates is the same every second and make a variable biger every second, If the variable reach 300 (300 seconds are 5 minutes) the player is automactly kicked


Re: 5 mins not moving -> afk -> kick ? - Calgon - 02.01.2011

What tour15 said is the most sufficient method.

Quote:
Originally Posted by [BADBOY]
Посмотреть сообщение
That system only works if the player is "paused" (alt-tabbed).


Re: 5 mins not moving -> afk -> kick ? - thimo - 02.01.2011

example please tour? or calgon?


Re: 5 mins not moving -> afk -> kick ? - Calgon - 02.01.2011

Quote:
Originally Posted by thimo
Посмотреть сообщение
example please tour? or calgon?
Take a look at an AFK kicking filterscript or half of the roleplaying gamemodes in the Gamemodes Release board.

I wrote up an example but I can't be bothered to complete it or test it.


Re: 5 mins not moving -> afk -> kick ? - Mean - 02.01.2011

Example:
pawn Код:
forward AFK(playerid);
new AFKtimer;
pawn Код:
public OnPlayerPause(playerid)
{
    AFKtimer = SetTimerEx("AFK", 300000, 0, "i", playerid);
    return 1;
}
pawn Код:
public OnPlayerUnPause(playerid)
{
    KillTimer(AFKtimer);
    return 1;
}
pawn Код:
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;
}
Done


Re: 5 mins not moving -> afk -> kick ? - Jochemd - 02.01.2011

I'd use the position method though, less script = less lag.


Re: 5 mins not moving -> afk -> kick ? - Hiddos - 02.01.2011

Quote:
Originally Posted by Jochemd
Посмотреть сообщение
I'd use the position method though, less script = less lag.
Not really, it matters how you're coding it.