AR/getElementHealth

From Multi Theft Auto: Wiki
Revision as of 02:42, 24 June 2016 by Ahmed Ly (talk | contribs) (نقول؟)
Jump to navigation Jump to search

هذه الوظيفة تقول بجلب دم الالمنت اوالشيئ.

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