GetAttachedElements
From Multi Theft Auto: Wiki
This function returns a table of all the elements attached to the specified element
Syntax
table getAttachedElements ( element theElement )
OOP Syntax Help! I don't understand this!
- Method: element:getAttachedElements(...)
Required Arguments
- theElement: The element which you require the information from.
Returns
Returns a table of all the elements attached to the specified element.
Example
Click to collapse [-]
Server-- Print a list of all the players attached to the specified element local Inf = getElementByID ( "infernus1" ) local attachedElements = getAttachedElements ( Inf ) if ( attachedElements ) then -- if we got the table local attachedElementsList = "none" -- Loop through the table for ElementKey, ElementValue in ipairs ( attachedElements ) do -- add their name to the list if ( getElementType ( ElementValue ) == "player" ) then if ( attachedElementsList == "none" ) then attachedElementsList = getPlayerName ( ElementValue ) else attachedElementsList = attachedElementsList .. ", " .. getPlayerName ( ElementValue ) end end end outputConsole ( "Players attached to the infernus: " .. attachedElementsList ) end
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