GetAllElementData: Difference between revisions
Jump to navigation
Jump to search
m (fix oop syntax) |
m (→See Also) |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{ | {{Shared function}} | ||
{{New feature/item|3.0161|1.6.0|21695|Added also as a client-side function. Previously only available as a server-side function.}} | |||
Returns a table of all element data of an element. | Returns a table of all element data of an element. | ||
Line 29: | Line 31: | ||
==See Also== | ==See Also== | ||
{{Element functions}} | {{Element functions|server}} |
Latest revision as of 22:30, 6 September 2024
Returns a table of all element data of an element.
Syntax
table getAllElementData ( element theElement )
OOP Syntax Help! I don't understand this!
- Method: element:getAllData(...)
Required Arguments
- theElement: the element you want to get the element data of.
Returns
If successful, returns a table with as keys the names of the element data and as values the corresponding element data values. Returns false in case of failure.
Example
This example script creates a new console command that displays all element data that is currently set on the player who enters the command.
function getMyData ( thePlayer, command ) local data = getAllElementData ( thePlayer ) -- get all the element data of the player who entered the command for k, v in pairs ( data ) do -- loop through the table that was returned outputConsole ( k .. ": " .. tostring ( v ) ) -- print the name (k) and value (v) of each element data, we need to make the value a string, since it can be of any data type end end addCommandHandler ( "elemdata", getMyData )
See Also
- addElementDataSubscriber
- clearElementVisibleTo
- cloneElement
- getElementSyncer
- getElementZoneName
- hasElementDataSubscriber
- isElementVisibleTo
- removeElementData
- removeElementDataSubscriber
- setElementSyncer
- setElementVisibleTo
- Shared
- 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