Help me about AFK check - 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: Help me about AFK check (
/showthread.php?tid=648443)
Help me about AFK check -
hoanduy - 22.01.2018
How do I know if the player is AFK or not, I have skipped a few topics but still do not understand the principle of its operation. Who can help me, please. Sorry for my bad english.
Re: Help me about AFK check -
RowdyrideR - 22.01.2018
Get the player position and make a timer.
Re: Help me about AFK check -
hoanduy - 22.01.2018
Quote:
Originally Posted by RowdyrideR
Get the player position and make a timer.
|
I still do not understand
Re: Help me about AFK check -
Sew_Sumi - 22.01.2018
You can have people tabbed, or in the menu, which will make OnPlayerUpdate not activate, which is the simplest check to see if someone is 'tabbed', but it also happens in the same way if they are just losing connection.
With checking the players position, you're checking that they aren't moving. This could also be coupled with checking when they last said anything in chat, or when they last used a command.
The later coupling can detect if someone is 'mobile' yet sitting in their friends car, being driven around.
Re: Help me about AFK check -
hoanduy - 22.01.2018
My goal is to recognize when the ESC or Alt-Tab user presses the AFK on their head, and when they come back, the SendClientMessage line is "You have AFK in minutes (minutes: seconds)".
Re: Help me about AFK check -
Zeth - 22.01.2018
Quote:
Originally Posted by hoanduy
My goal is to recognize when the ESC or Alt-Tab user presses the AFK on their head, and when they come back, the SendClientMessage line is "You have AFK in minutes (minutes: seconds)".
|
You can achieve the same^ using
Emmet's Callbacks Include.
It checks for alt-tab and ESC but it won't check player movement. You can do some modifications by adding a camera movement check and a player position check.
-
Sew_Sumi - 22.01.2018
You don't even need the include for such a minor thing...
"We'll just add 100 new 'features' only to use 1"... Seems legit.