GetPedOxygenLevel

From Multi Theft Auto: Wiki
Revision as of 16:52, 1 October 2012 by Lexr128 (talk | contribs)
Jump to navigation Jump to search

This function returns the current oxygen level of the specified ped.

Syntax

float getPedOxygenLevel ( ped thePed )

Required Arguments

  • thePed: The ped whose oxygen level you want to check

Returns

A float with the oxygen level, false if an invalid ped was given.

Example

Click to collapse [-]
Client

This example defines a "showoxygen" console command that shows the player that executes it which oxygen level he has.

function showOxygen ( command )
	local oxygen = getPedOxygenLevel ( localPlayer )
	outputChatBox( "Your oxygen level: " .. oxygen )
end
addCommandHandler ( "showoxygen", showOxygen )

See Also