Posts: 337
Threads: 86
Joined: Dec 2011
Reputation:
0
I have one problem with my gang capture zones. When a player is in the menu or tabbed out of the game they can remain in the checkpoint and capture the zone. How can I detect if they are in the menu or tabbed out - How can I prevent this? Any examples would be great! I've been scripting my GM for nearly 2 years and I can't remember whether I put in an AFK system but I'm pretty sure I didn't and this is the standard thing with SA-MP.
Would it be PLAYER_STATE_NONE?
Posts: 2,698
Threads: 37
Joined: Mar 2012
Reputation:
0
It's simple - OnPlayerUpdate callback don't get called when the player is paused. So you could calculate whether player is AFK or not by running a timer and checking if OnPlayerUpdate was called or not at that interval and declare whether the player was AFK or not.
Posts: 337
Threads: 86
Joined: Dec 2011
Reputation:
0
Ahhh I see. Any chance of an example?
EDIT: Not to worry my brain is alive again I know what to do... I've been having too many brain farts lately but thankyou very much for your help.
Posts: 337
Threads: 86
Joined: Dec 2011
Reputation:
0
03.02.2014, 17:56
(
Последний раз редактировалось Phil_Cutcliffe; 03.02.2014 в 20:25.
)
Ok I still have one problem.. Everything works fine BUT when a player tabs he is still in god mode. And when I use your OnPlayerPause to kill them if they're in a capture zone it doesn't work until they tab back into game. I need it to work straight away.
EDIT: All sorted now I figured a perfect way to do it