Posts: 7
Threads: 2
Joined: Jul 2017
Reputation:
0
How do you determine if the player is in an AFK state and what I mean by AFK here is by pressing the ESC key or cutting out the game please call me back or the function
I am a Chinese. Maybe my English is not very good. Please understand that the samp in China is about to stop running
thanks!
Posts: 7
Threads: 2
Joined: Jul 2017
Reputation:
0
I mean is
How to check whether the player is in AFK state
There are no relative functions or callbacks
Posts: 6,242
Threads: 8
Joined: Jun 2008
That's not AFK, that's Alt-Tabbed. OnPlayerUpdate doesn't get updated when the player is tabbed. But because of it's nature, bad internet can also cause packet-loss which will also not update OnPlayerUpdate.
This has been asked so many times before.
Posts: 7
Threads: 2
Joined: Jul 2017
Reputation:
0
So how do you detect a player in alt-tabbed?
Posts: 6,242
Threads: 8
Joined: Jun 2008
https://sampforum.blast.hk/showthread.php?tid=281590
AFK is more sitting idle, in a car, or in a house not moving.
Alt-tabbed is in the menu/map, out in other apps.
packet loss, and a bad connection can cause the alt-tabbed scenario to trigger, as it's dropping packets and hence not having OnPlayerUpdate call as much as it should. This include likely copes with this.
Posts: 6,242
Threads: 8
Joined: Jun 2008
^^ This is pretty good, for finding the tabbed players.
Just remember it will pick up people with bad connections, and people who are looking at the map.