AR/setElementHealth
From Multi Theft Auto: Wiki
هذه الوظيفة تعطي الالمنت او الشيئ دم .
Syntax
bool setElementHealth ( element theElement, float newHealth )
OOP Syntax Help! I don't understand this!
- Method: element:setHealth(...)
- Variable: .health
Required Arguments
- theElement: الالمنت او الشيئ الذي تريد اعطائه دم ويكون: شخص,سيارة,ابجكت.
- newHealth: كمية الدم التي تريد اعطائها للالمنت او الشيئ .
Example
Click to collapse [-]
Serverfunction hpSlap ( sourcePlayer, command, targetPlayerName ) --ان كان الاعب يملك خاصية السلاب if not hasObjectPermissionTo(sourcePlayer, "command.slap", false) then outputChatBox ( "You cannot use this command.", sourcePlayer )--كلام بالشات return false end --يجلب الاعب من اسمه local targetPlayer = getPlayerFromName ( targetPlayerName ) if targetPlayer then --يقول بأنقاص 20 دم setElementHealth ( targetPlayer, getElementHealth(targetPlayer) - 20 ) else outputChatBox ( "There is no player named " .. targetPlayerName .. "!", sourcePlayer ) end end --عند كتابة "hpslap" addCommandHandler ( "hpslap", hpSlap )
See Also
- attachElements
- clearElementVisibleTo
- cloneElement
- createElement
- destroyElement
- detachElements
- getAllElementData
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementCollisionsEnabled
- getElementByID
- getElementByIndex
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementColShape
- getElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementSyncer
- getElementType
- getElementVelocity
- getElementZoneName
- getElementsByType
- getElementsWithinColShape
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementVisibleTo
- isElementWithinColShape
- isElementWithinMarker
- removeElementData
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementSyncer
- setElementVelocity
- setElementVisibleTo
- setLowLODElement