GetElementRadius

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

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