GetElementBoundingBox

From Multi Theft Auto: Wiki
Revision as of 15:53, 20 August 2007 by Arc (talk | contribs)
Jump to navigation Jump to search

This function returns the minimum and maximum coordinates of an element's bounding box.

Syntax

float float float float float float getElementBoundingBox ( element theElement )

Required Arguments

theElement: the element whose bounding box we want to get.

Returns

  • Returns min x, min y, min z, max x, max y, max z if the passed element is valid, false otherwise.

Example

This example outputs to chatbox the minimum and the maximum coordinates of an element.

function minMaxOutput( element )
    local x0, y0, z0, x1, y1, z1 = getElementBoundingBox ( element )
    if ( x0 ) then
        outputChatBox( "The coords are: " .. x0 .. ", " .. y0 .. ", " .. z0 .. ", " .. x1 .. ", " .. y1 .. ", " .. z1 )
    else
        outputChatBox( "Failed to retrieve bounding box" )
    end
end

See Also