IsElementAttached
From Multi Theft Auto: Wiki
This functions checks whether or not an element is attached to another element.
Syntax
bool isElementAttached ( element theElement )
OOP Syntax Help! I don't understand this!
- Method: element:isAttached(...)
- Variable: .attached
Required Arguments
- theElement: The element to check for attachment.
Returns
Returns true if the specified element is attached to another element, false if it is not attached or nil if an improper argument was passed.
Example
This examples checks if a player is attached to anything when they enter a console command:
-- add a command handler for 'amiattached' to call the function 'consoleIsPlayerAttached': function consoleIsPlayerAttached ( thePlayer, command ) if ( thePlayer ) then -- if a player triggered this command local status = isElementAttached ( thePlayer ) -- call the function and store it's result in the 'status' variable if ( status ) then -- if the function returned true, tell the player he is attached to something outputConsole ( "You are attached to an element!", thePlayer ) else -- if the function returned false, tell the player he is not attached to anything outputConsole ( "You are not attached to an element.", thePlayer ) end end end addCommandHandler ( "amiattached", consoleIsPlayerAttached )
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