IsPedOnFire: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{Server client function}} | ||
This function checks if the specified [[ped]] is on fire or not. | |||
{{deprecated|isElementOnFire}} | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">bool isPedOnFire ( ped thePed )</syntaxhighlight> | <syntaxhighlight lang="lua">bool isPedOnFire ( ped thePed )</syntaxhighlight> | ||
Line 7: | Line 10: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''thePed''': | *'''thePed''': The [[ped]] to check. | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if the ped is on fire, ''false'' otherwise. | Returns ''true'' if the ped is on fire, ''false'' otherwise. | ||
== | ==Example== | ||
<section class="server" name="Server" show="true"> | <section class="server" name="Server" show="true"> | ||
This example checks if a random player is on fire, and if so gives him a fire extinguisher. | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
local randomPlayer = getRandomPlayer() | local randomPlayer = getRandomPlayer() | ||
if isPedOnFire ( randomPlayer ) then | if isPedOnFire ( randomPlayer ) then | ||
giveWeapon ( randomPlayer, 42, 100, true ) | giveWeapon ( randomPlayer, 42, 100, true ) | ||
end | end | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> |
Latest revision as of 03:04, 31 December 2024
This function checks if the specified ped is on fire or not.
This function is deprecated. This means that its use is discouraged and that it might not exist in future versions. | |
Please use isElementOnFire instead. |
Syntax
bool isPedOnFire ( ped thePed )
OOP Syntax Help! I don't understand this!
- Method: ped:isOnFire(...)
- Variable: .onFire
- Counterpart: setPedOnFire
Required Arguments
- thePed: The ped to check.
Returns
Returns true if the ped is on fire, false otherwise.
Example
Click to collapse [-]
ServerThis example checks if a random player is on fire, and if so gives him a fire extinguisher.
local randomPlayer = getRandomPlayer() if isPedOnFire ( randomPlayer ) then giveWeapon ( randomPlayer, 42, 100, true ) end
See Also
- 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