IsPedOnFire: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
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 8: Line 7:


===Required Arguments===
===Required Arguments===
*'''thePed''': The [[ped]] to check.
*'''thePed''': الشخصية الذي تود التحقق اذا كانت بالنار او لا


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

Revision as of 20:59, 18 May 2020

هذه الوظيفة تتحقق إذا كانت الشخصية في النار أو لار

Syntax

bool isPedOnFire ( ped thePed )

OOP Syntax Help! I don't understand this!

Method: ped:isOnFire(...)
Variable: .onFire
Counterpart: setPedOnFire


Required Arguments

  • thePed: الشخصية الذي تود التحقق اذا كانت بالنار او لا

Returns

Returns true if the ped is on fire, false otherwise.

مثال

Click to collapse [-]
Server

هذا المثال يتحقق من لاعب عشوائي اذا كان بالنار او لا ويعطيه طفاية الحريق

local randomPlayer = getRandomPlayer() -- جلب لاعب عشوائي من السيرفر
if isPedOnFire ( randomPlayer ) then -- تحقق اذا كان اللاعب فوق النار
	giveWeapon ( randomPlayer, 42, 100, true ) -- اعطاء اللاعب طفاية الحريق
end -- إغلاق التحقق ..

See Also

Shared