AR/getElementHealth: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Server client function}} __NOTOC__ هذه الوظيفة تقول بجلب دم الالمنت اوالشيئ. ==Syntax== <syntaxhighlight lang="lua"> float getElementHealth ( element the...")
 
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{Server client function}}
{{Server client function}}
__NOTOC__
__NOTOC__
هذه الوظيفة تقول بجلب دم الالمنت اوالشيئ.
هذهـ الوظيفة تسمح للاعب بجلب صحة العنصر
العناصر التي يمكنك جلب صحتها : السيارة , الشخصية الوهمية ( البيد ) , اللاعب


==Syntax==
==Syntax==
Line 10: Line 11:


===شرح الارقمنتات===
===شرح الارقمنتات===
*'''theElement:''' الالمنت = الاعب او السيارة الذي تريد جلب دمها.
*'''theElement:''' العنصر الذي تريد جلب صحته




Line 19: Line 20:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function showLocalHealth()
function showLocalHealth()
--نقول بجلب دم الاعب
-- نقوم بجلب دم الاعب
local playerHealth = getElementHealth ( localPlayer )
local playerHealth = getElementHealth ( localPlayer )
outputChatBox ( "Your health: " .. playerHealth ) --نخرج كلام بالشات بعدد الدم
outputChatBox ( "Your health: " .. playerHealth ) --نخرج كلام بالشات بعدد الدم
--نقوم بجلب دم السيارة
--نقوم بجلب دم السيارة
local playerVehicle = getPedOccupiedVehicle ( localPlayer )
local playerVehicle = getPedOccupiedVehicle ( localPlayer )

Latest revision as of 14:38, 7 November 2017

هذهـ الوظيفة تسمح للاعب بجلب صحة العنصر العناصر التي يمكنك جلب صحتها : السيارة , الشخصية الوهمية ( البيد ) , اللاعب

Syntax

float getElementHealth ( element theElement )

OOP Syntax Help! I don't understand this!

Method: element:getHealth(...)
Variable: .health


شرح الارقمنتات

  • theElement: العنصر الذي تريد جلب صحته


مثال

Click to collapse [-]
Clientside example

هذا المثال عند كتابة كلمة باف8 يجلب دم الاعب + السيارة بالشات.

function showLocalHealth()
	-- نقوم بجلب دم الاعب
	local playerHealth = getElementHealth ( localPlayer )
	outputChatBox ( "Your health: " .. playerHealth ) --نخرج كلام بالشات بعدد الدم
	--نقوم بجلب دم السيارة
	local playerVehicle = getPedOccupiedVehicle ( localPlayer )
	if playerVehicle then
		local vehicleHealth = getElementHealth ( playerVehicle ) / 10 
		outputChatBox ( "Your vehicle's health: " .. vehicleHealth ) --نخرج كلام بالشات بدم السيارة
	end
end
addCommandHandler ( "showhealth", showLocalHealth )--عند الكتابة باف8

See Also

Shared