GetPedOxygenLevel: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ {{Client function}} This function returns the current oxygen level of the specified ped. ==Syntax== <syntaxhighlight lang="lua">float getPedOxygenLevel ( ped thePed )</syntaxhighlight> ===Re...")
 
(Added OOP syntax)
 
(One intermediate revision by one other user not shown)
Line 5: Line 5:
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">float getPedOxygenLevel ( ped thePed )</syntaxhighlight>
<syntaxhighlight lang="lua">float getPedOxygenLevel ( ped thePed )</syntaxhighlight>
{{OOP||[[ped]]:getOxygenLevel|oxygenLevel|setPedOxygenLevel}}


===Required Arguments===
===Required Arguments===
Line 25: Line 26:


==See Also==
==See Also==
{{Ped functions}}
{{Client_ped_functions}}

Latest revision as of 17:46, 26 November 2014

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

Syntax

float getPedOxygenLevel ( ped thePed )

OOP Syntax Help! I don't understand this!

Method: ped:getOxygenLevel(...)
Variable: .oxygenLevel
Counterpart: setPedOxygenLevel


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