SetPedOxygenLevel: Difference between revisions
Jump to navigation
Jump to search
(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> ==...") |
No edit summary |
||
Line 8: | Line 8: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''thePed''': the [[ped]] whose oxygen level you want to modify. | *'''thePed''': the [[ped]] whose oxygen level you want to modify. | ||
*'''oxygen''': the amount of oxygen you want to set on the ped. | *'''oxygen''': the amount of oxygen you want to set on the ped. Native values are from 0 to 1750 (At the maximum value of UNDERWATER_STAMINA full oxygen level is 3252. Higher values do not appear in the HUD). | ||
===Returns=== | ===Returns=== | ||
Line 18: | Line 18: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function fillOxygen ( command ) | function fillOxygen ( command ) | ||
setPedOxygenLevel ( localPlayer, | local maxOxygen = getPedStat ( localPlayer, 225 ) * 1.502 + 1750 | ||
setPedOxygenLevel ( localPlayer, maxOxygen ) | |||
end | end | ||
addCommandHandler ( "filloxygen", fillOxygen ) | addCommandHandler ( "filloxygen", fillOxygen ) | ||
Line 26: | Line 27: | ||
==See Also== | ==See Also== | ||
{{ | {{Client_ped_functions}} |
Revision as of 16:09, 1 October 2012
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. Native values are from 0 to 1750 (At the maximum value of UNDERWATER_STAMINA full oxygen level is 3252. 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 [-]
ClientThis example fills the local player's oxygen.
function fillOxygen ( command ) local maxOxygen = getPedStat ( localPlayer, 225 ) * 1.502 + 1750 setPedOxygenLevel ( localPlayer, maxOxygen ) end addCommandHandler ( "filloxygen", fillOxygen )
See Also
- canPedBeKnockedOffBike
- getPedAnalogControlState
- getPedAnimation
- getPedBonePosition
- getPedCameraRotation
- getPedControlState
- getPedMoveState
- getPedOxygenLevel
- getPedSimplestTask
- getPedTargetCollision
- getPedTargetEnd
- getPedTargetStart
- getPedTask
- getPedVoice
- getPedWeaponMuzzlePosition
- givePedWeapon
- isPedBleeding
- isPedDoingTask
- isPedReloadingWeapon
- isPedTargetingMarkerEnabled
- setAnalogControlState
- setPedAimTarget
- setPedAnalogControlState
- setPedBleeding
- setPedCameraRotation
- setPedCanBeKnockedOffBike
- setPedControlState
- setPedEnterVehicle
- setPedExitVehicle
- IsPedFootBloodEnabled
- setPedFootBloodEnabled
- setPedLookAt
- setPedOxygenLevel
- setPedTargetingMarkerEnabled
- setPedVoice
- Shared
- addPedClothes
- getPedClothes
- removePedClothes
- createPed
- getPedAmmoInClip
- getPedArmor
- getPedFightingStyle
- getPedOccupiedVehicle
- getPedOccupiedVehicleSeat
- getPedStat
- getPedTarget
- getPedTotalAmmo
- getPedWalkingStyle
- getPedWeapon
- getPedWeaponSlot
- getPedContactElement
- getValidPedModels
- isPedChoking
- isPedDead
- isPedDoingGangDriveby
- isPedDucked
- isPedHeadless
- isPedInVehicle
- isPedOnFire
- isPedOnGround
- isPedWearingJetpack
- killPed
- removePedFromVehicle
- setPedAnimation
- setPedAnimationProgress
- setPedAnimationSpeed
- setPedArmor
- setPedDoingGangDriveby
- setPedFightingStyle
- setPedHeadless
- setPedOnFire
- setPedStat
- setPedWalkingStyle
- setPedWeaponSlot
- warpPedIntoVehicle