Jump to content

Oxygen functions


Xierra

Recommended Posts

Hi guys!

I want the MTA Team to add these functions client side & server side:

setPedOxygenLevel (ped thePlayer, amount)

getPedOxygenLevel (ped thePlayer)

With getting at amount 0 - 100, as on the example below.

example:

function getBreath
breath = getPedOxygenLevel (getLocalPlayer())
 
if breath <=25 then
outputChatBox("Get out of the water now! You're drowning!!" , 255,0,0, true)
 
else 
outputChatBox ("You still can hold your breath longer.", 255, 255, 0, true)
end
end
addCommandHandler("checklung", getBreath)

PS: Dunno if it works! :P

Phatlooser already requested for this. But nobody looks at it?

These functions are used to get the oxygen amount / lung capacity (as seen on the bar between armor and health when in water)

It would be good to you guys if these functions are added.

The Bugs page: http://www.bugs.mtasa.com/view.php?id=5350

And I confirmed at that suggestion.

Link to comment

Address is 0x00B7CDE2. Value when bar is full: 17530, not sure for when bar is empty, but around 16900..

I froze it in Cheat engine and the bar doesn't decrease when under water, and player can't die from drowning. Now searching address of how fast it decrease/increase (I found it earlier I think, but now I've lost it..)

Link to comment

Sorry I was wrong, I think the correct address is 0x00B7CDE0 which normal value is 1000.0, and as expected, a value of 0 is when you start losing health 'normally' (with a value of 30, you lose health only if you swim, but if you don't move, you don't lose health)

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...