GetElementRadius
From Multi Theft Auto: Wiki
This function gets the radius of an element. Normally, sphere or circle-shaped elements tend to return a more accurate and expected radius than others with another shapes.
Syntax
float getElementRadius ( element theElement )
OOP Syntax Help! I don't understand this!
- Method: element:getRadius(...)
- Variable: .radius
Required Arguments
- theElement: The element to get the radius of. It can be any entity type, such as:
Returns
Returns a float containing the radius if the element is valid, false otherwise.
Example
This example shows how to get and output the radius of every player who types the /getmyradius command (which will always be 1).
local function outputLocalPlayerRadius() outputChatBox("Your radius is " .. getElementRadius(localPlayer)) end addCommandHandler("getmyradius", outputLocalPlayerRadius)
See Also
- attachElements
- createElement
- destroyElement
- detachElements
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementBoundingBox
- getElementByID
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementColShape
- getElementCollisionsEnabled
- getElementData
- getElementDimension
- getElementDistanceFromCentreOfMassToBaseOfModel
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRadius
- getElementRotation
- getElementType
- getElementVelocity
- getElementsByType
- getElementsWithinColShape
- getElementsWithinRange
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementCollidableWith
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLocal
- isElementLowLOD
- isElementOnScreen
- isElementStreamable
- isElementStreamedIn
- isElementSyncer
- isElementWaitingForGroundToLoad
- isElementWithinColShape
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollidableWith
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementMatrix
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementStreamable
- setElementVelocity
- setLowLODElement