IsPedOnFire: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(New page: __NOTOC__ {{Server client function}} This function checks if the specified ped is on fire or not. ==Syntax== <syntaxhighlight lang="lua">bool isPedOnFire ( ped thePed )</syntaxhighlight> ===Required Arguments...)
 
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 5: Line 5:
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">bool isPedOnFire ( ped thePed )</syntaxhighlight>
<syntaxhighlight lang="lua">bool isPedOnFire ( ped thePed )</syntaxhighlight>
{{OOP||[[ped]]:isOnFire|onFire|setPedOnFire}}


===Required Arguments===
===Required Arguments===
Line 16: Line 17:
This example checks if a random player is on fire, and if so gives him a fire extinguisher.
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>
 
[[ar:isPedOnFire]]
==See Also==
==See Also==
{{Ped functions}}
{{Ped functions}}

Latest revision as of 21:05, 18 May 2020

This function checks if the specified ped is on fire or not.

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 [-]
Server

This 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