Afk detector - 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)
+--- Thread: Afk detector (
/showthread.php?tid=507953)
Afk detector -
iBots - 19.04.2014
I have seen few servers having perfect afk system,when you press on esc,it automaticly puts a timer above your head and counts the seconds you are afk for,i asked one of the server's owners he told me that they dont use OnPlayerUpdate and if he dorsnt update for few minutes he gets counted ask afk,and he doesnt use position thing,then what is he using?he doesnt want to tell me thats why i am asking here,i just want to know how do they know if you are afk,when you just press on esc it knows,how?
Re: Afk detector -
DobbysGamertag - 20.04.2014
There's one way i can think of doing it something like this:
pawn Код:
new LastActive[MAX_PLAYERS];
//under some callback that requires user input (dialog response/onplayertext etc)
LastActive[playerid] = gettime();
//to check:
if(LastActive[playerid] > 5*60)// whatever you want here for being counted as AFK. I used 5 mins as an example.
{
//code here.
}
Re: Afk detector -
iBots - 20.04.2014
Not like that way....anyone

?