AR/setElementHealth
Jump to navigation
Jump to search
هذه الوظيفة تعطي الالمنت او الشيئ دم .
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
- createElement
- destroyElement
- detachElements
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementByIndex
- getElementByID
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementCollisionsEnabled
- getElementColShape
- getElementData
- getAllElementData
- hasElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementsByType
- getElementsWithinColShape
- getElementsWithinRange
- getElementType
- getElementVelocity
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementWithinColShape
- isElementWithinMarker
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementVelocity
- setLowLODElement
- getPedContactElement
- getResourceDynamicElementRoot
- getResourceRootElement