SetElementData: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 18: | Line 18: | ||
Returns ''true'' if the data was set succesfully, ''false'' otherwise. | Returns ''true'' if the data was set succesfully, ''false'' otherwise. | ||
==Example== | |||
<section name="Server" class="server" show="false"> | <section name="Server" class="server" show="false"> | ||
This example allows for a player to add a custom tag onto their nickname, and also revert it back to normal if they wish | This example allows for a player to add a custom tag onto their nickname, and also revert it back to normal if they wish | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> |
Revision as of 11:57, 12 August 2007
This function stores data attached to an element. This data can be any primitive LUA type or MTA element (but not a text item or display).
Element data is a useful way to store data attached to players.
Syntax
bool setElementData ( element theElement, string key, var value )
Required Arguments
- theElement: The element you wish to attach the data to
- key: The key you wish to store the data under
- value: The value you wish to store
Returns
Returns true if the data was set succesfully, false otherwise.
Example
Click to expand [+]
ServerSee 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