OnPlayerPauseGame -
mirou123 - 05.03.2014
Hello everyone.So SAMP clearly detects if someone is paused because when he does a small icon will appear above his head.Is there any way to use that to detect if a player is AFK?Cause abviously it's easier,more accurate and we don't have to use useless timers.And if not why don't SAMP team add a callback or a function to detect the paused players.
Re: OnPlayerPauseGame -
Luis- - 05.03.2014
Eh..?
Re: OnPlayerPauseGame -
Konstantinos - 05.03.2014
Quote:
Originally Posted by Luis-
Eh..?
|
He means that when a player is paused, it detects that and appears a hourglass above the player's head. Since it detects that already why not to have a callback by SA-MP team instead of using OPU and a timer to detect it via the script.
Re: OnPlayerPauseGame -
Vince - 05.03.2014
Actually, it is the client that detects this, not the server. The client detects that you're not receiving updates from a player and will a render an hourglass above that user's head. And as we all know, clients can't be trusted when it comes to triggering events.
Re: OnPlayerPauseGame -
Pottus - 05.03.2014
The hour glass is client sided yes so you need to use OPU
Re: OnPlayerPauseGame -
FufLa - 05.03.2014
Quote:
Originally Posted by [uL]Pottus
The hour glass is client sided yes so you need to use OPU
|
This, it also shows up when you're experiencing desync/lag spikes.
Re : OnPlayerPauseGame -
mirou123 - 06.03.2014
Oh,so when a player pauses the game it will stop sending updates?and if so would it be paussible to detect that under OnPlayerUpdate?
Re: Re : OnPlayerPauseGame -
FufLa - 06.03.2014
Quote:
Originally Posted by mirou123
Oh,so when a player pauses the game it will stop sending updates?and if so would it be paussible to detect that under OnPlayerUpdate?
|
Search on the forums for OnPlayerPause or something like that. 500 scripts for that already.
Re : OnPlayerPauseGame -
mirou123 - 07.03.2014
Okay thanks
Re: OnPlayerPauseGame -
Jay_ - 07.03.2014
Quote:
Originally Posted by Vince
Actually, it is the client that detects this, not the server. The client detects that you're not receiving updates from a player and will a render an hourglass above that user's head. And as we all know, clients can't be trusted when it comes to triggering events.
|
Actually IIRC I was told that this works the same way as most other scripts on these forums do: it simply monitors the time in which the client sent the last update to the server and if the last update was received in what the server would consider to be a long time, then it flags the client as being inactive.