SA-MP Forums Archive
Pausing feature. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Pausing feature. (/showthread.php?tid=183751)



Pausing feature. - OldDirtyBastard - 16.10.2010

Hello everyone, i wanna make that everytime someone pauses,
his blip should dissapear from the minimap(radar)
and his name colour should turn into a grey colour,
when he comes back from AFK everything should turn to normal,
his colour and his blip should be visible again on the minimap.
Can somebody tell me how to do it?
Thanks, regards.


Re: Pausing feature. - dillo1000 - 16.10.2010

I would love to see someone do this I would also use this script for my RP.


Re: Pausing feature. - Scenario - 16.10.2010

It's been done on one server, but I'm not sure how. I'd like to see some working code on this too!


Re: Pausing feature. - MadeMan - 16.10.2010

OnPlayerUpdate doesn't get called, when player is paused.

So make a timer and check if OnPlayerUpdate isn't called for example 5 seconds then hide the marker and set player color.


Re: Pausing feature. - Austin - 16.10.2010

You could use the fps counter code to achieve the paused effect. Less intensive than OnPlayerUpdate.


Re: Pausing feature. - cmg4life - 16.10.2010

Hint: OnPlayerUpdate returns 0 if the player is in Escape/ Alt+Tab (minimized game) mode.

You can work something based on that.

Maybe setting a variable on onplayerupdate... and a timer sets it to normal after it checks it's value.

Or using unix time, if more then 2 seconds passed and the unix isn't updated then it's paused.


Re: Pausing feature. - Austin - 16.10.2010

Quote:
Originally Posted by cmg4life
Посмотреть сообщение
Hint: OnPlayerUpdate returns 0 if the player is in Escape/ Alt+Tab (minimized game) mode.

You can work something based on that.

Maybe setting a variable on onplayerupdate... and a timer sets it to normal after it checks it's value.

Or using unix time, if more then 2 seconds passed and the unix isn't updated then it's paused.
No it does not pass 0, that's your own choice to do that, and it desync you from other players if you do.


Re: Pausing feature. - Finn - 16.10.2010

You could try the search feature these forums have, it's pretty cool thing.

Try YUP.


Re: Pausing feature. - cmg4life - 16.10.2010

OOOps.

I meant it's not called. Sorry.



PS: I'll look on that fps counter code.


Re: Pausing feature. - OldDirtyBastard - 16.10.2010

or maybe when a player preses the esc key, could it be posible that way?