getElementAttachedTo | Multi Theft Auto: Wiki Skip to content

getElementAttachedTo

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function determines the element that the specified element is attached to.

Syntax

getElementAttachedTo ( )

Code Examples

server

This example defines a console command that outputs the type of the element that the player is attached to.

function getAttached ( thePlayer )
local attached = getElementAttachedTo ( thePlayer )
if ( attached ) then
outputConsole ( getPlayerName(thePlayer) .. " is attached to a " .. getElementType(attached) )
else
outputConsole ( getPlayerName(thePlayer) .. " is not attached to an element" )
end
end
addCommandHandler ( "getattached", getAttached )

See Also

Element Functions