AR/getElementHealth

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

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