SA-MP Forums Archive
Any way to get oxygen level? - 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: Any way to get oxygen level? (/showthread.php?tid=326274)



Any way to get oxygen level? - Baboon - 16.03.2012

Hey guys,
whenever you start to dive you will start to loose some oxygen (check the bar).
Any way to get the oxygen level of a player?

thnx


Re: Any way to get oxygen level? - FireCat - 16.03.2012

Erhmm detect when the players anim is the same as he's swimming, then set a timer to make a var to count down... (:


Re: Any way to get oxygen level? - SimonItaly - 16.03.2012

I was thinking about something like that some days ago.
First, find all the diving animations IDs. Second, find the exact time that SAMP makes you spend underwater before die.
Then you've to check if the player's using an underwater animation, then check every second if he's still underwater, subtracting that time to the amount of GTA's stardard diving time.


Re: Any way to get oxygen level? - Baboon - 16.03.2012

ye I already was affraid to do that with a timer. Hmmpf. Okido, going to script a bit and look for the time.
thnx guys, repped.


Re: Any way to get oxygen level? - new121 - 16.03.2012

Timers are not 100 percent accurate. There is an includes that makes them accurate though.