SetPedOxygenLevel

From Multi Theft Auto: Wiki
Revision as of 12:21, 1 October 2012 by Jusonex (talk | contribs) (Created page with "__NOTOC__ {{Client function}} This function allows you to set the oxygen level of a ped. ==Syntax== <syntaxhighlight lang="lua">bool setPedOxygenLevel ( ped thePed, float oxygen )</syntaxhighlight> ==...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function allows you to set the oxygen level of a ped.

Syntax

bool setPedOxygenLevel ( ped thePed, float oxygen )

Required Arguments

  • thePed: the ped whose oxygen level you want to modify.
  • oxygen: the amount of oxygen you want to set on the ped. Valid values are from 0 to 1000 (Higher values do not appear in the HUD).

Returns

Returns true if the oxygen level was changed succesfully. Returns false if an invalid ped and/or oxygen level was specified.

Example

Click to collapse [-]
Client

This example fills the local player's oxygen.

function fillOxygen ( command )
	setPedOxygenLevel ( localPlayer, 1000 )
end
addCommandHandler ( "filloxygen", fillOxygen )


See Also