RemoveElementData: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m (→Example: No need for section) |
||
Line 16: | Line 16: | ||
==Example== | ==Example== | ||
This will create an element data for know if a player has spawned. | This will create an element data for know if a player has spawned. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Line 27: | Line 26: | ||
end | end | ||
addEventHandler ( "onPlayerWasted", getRootElement(), wasted )</syntaxhighlight> | addEventHandler ( "onPlayerWasted", getRootElement(), wasted )</syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{Element_functions}} | {{Element_functions}} |
Revision as of 16:33, 16 August 2014
This function removes the element data with the given key for that element. The element data removal is synced with all the clients.
Syntax
bool removeElementData ( element theElement, string key )
Required Arguments
- theElement: The element you wish to remove the data from.
- key: The key string you wish to remove.
Returns
Returns true if the data was removed succesfully, false if the given key does not exist in the element or the element is invalid.
Example
This will create an element data for know if a player has spawned.
function spawn() setElementData(source,"spawned",true) end addEventHandler ( "onPlayerSpawn", getRootElement(), spawn ) function wasted() removeElementData(source,"spawned") end addEventHandler ( "onPlayerWasted", getRootElement(), wasted )
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