SA-MP Forums Archive
[FilterScript] AFK system, making AFK players invisble - 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: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] AFK system, making AFK players invisble (/showthread.php?tid=357464)



AFK system, making AFK players invisble - Supercop - 07.07.2012

This is a simple AFK system that make players who are AFK for 15 minutes invisible. When the player gets back from AFK, he will be visible again.

- Each second all players will be checked and their old coordinates stored
- If at the next check the location did not change, the player is considered AFK and will be checked each second again.
- After 900 seconds (15 minutes) of being AFK, the player will be set in another VW
- If the player is back and moves, he is no longer AFK. The AFK timer will reset and if the player was invisible, he'll be visible again
- If the player types something, the AFK timer resets
- If the player disconnects, he will be visible again to avoid problems with servers that save player data
- This only works for people in VW 0 already

Pastebin;
http://pastebin.com/jvdxjqyb


Re: AFK system, making AFK players invisble - jaami - 07.07.2012

Very nice AFK system. Good job.


Re: AFK system, making AFK players invisble - Supercop - 07.07.2012

Thank you, my first FS released.


Re: AFK system, making AFK players invisble - coole210 - 07.07.2012

I have seen many AFK systems, and even made my own but for a first FS, this is great. Very clean, organised, explained, and easy for beginners to understand. A reputation for you sir.


Re: AFK system, making AFK players invisble - Sinner - 07.07.2012

Nice script, but you should also save the original virtual world and interior. If the player goes AFK in (for example) world 60 he will be put back to his original position but in world 0 when he returns. Same for the interior.


Re: AFK system, making AFK players invisble - Supercop - 07.07.2012

Quote:
Originally Posted by Sinner
Посмотреть сообщение
Nice script, but you should also save the original virtual world and interior. If the player goes AFK in (for example) world 60 he will be put back to his original position but in world 0 when he returns. Same for the interior.
The VW won't be adjusted if the player's VW is different than 0, to avoid this problem.


Re: AFK system, making AFK players invisble - shayan122 - 07.07.2012

its nice and better than other afk systems


Respuesta: AFK system, making AFK players invisble - Gamer_007 - 08.07.2012

so nice but i got 13 warns


Re: AFK system, making AFK players invisble - Supercop - 09.07.2012

I see, still works though.

Anyone who uses this for his server already? Opinions?


AW: AFK system, making AFK players invisble - sNaq - 09.07.2012

SetTimer("Timer", 1000, true);
public Timer(playerid)
{
....
}

stupid question, but how does this work ? i dont get where the value of playerid came from