IsPedOnFire: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same 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.
 
==Syntax==
==Syntax==
<syntaxhighlight lang="lua">bool isPedOnFire ( ped thePed )</syntaxhighlight>
<syntaxhighlight lang="lua">bool isPedOnFire ( ped thePed )</syntaxhighlight>
Line 7: Line 8:


===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 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

Shared