SA-MP Forums Archive
Check Player Pause - 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: Check Player Pause (/showthread.php?tid=431405)



Check Player Pause - Petricko - 18.04.2013

Do someone can tell me how to check whether the player is in the ESC menu (pause).


Re: Check Player Pause - Krx17 - 18.04.2013

There is no function that tells you if a player is paused or not. The best way to do so is to check if a player has no moved in 3-5 minutes and then determine if he/she is afk.


Re: Check Player Pause - Petricko - 18.04.2013

I know that, but I need to check when the player robing could not keep the ESC menu... This is what I want so I can not do this way ...


Re: Check Player Pause - FalconX - 18.04.2013

Quote:
Originally Posted by Petricko
Посмотреть сообщение
I know that, but I need to check when the player robing could not keep the ESC menu... This is what I want so I can not do this way ...
As far as I know, when the player pauses, OnPlayerUpdate stops working so you can do like IsPause[ playerid ] = 0; at OnPlayerUpdate and in a timer IsPause[ playerid ]++; which counts the seconds of the player being paused. So you can use a "if/else" statement to know if the player is paused;

pawn Код:
if( IsPause[ playerid ] > 5 ) // if player is afk from 5 second or w/e
{
// your code
}
Edit: There are some includes or useful snippets in the forum regarding this, you may find it by search button.

Regards FalconX