GetElementRadius

From Multi Theft Auto: Wiki
Revision as of 21:27, 31 August 2012 by Jaysds1 (talk | contribs)
Jump to navigation Jump to search

This function gets the radius from a element. Depending on the shape of the element this may be an accurate or very inaccurate way to detect if the player is near or within the element.


Syntax

float getElementRadius ( element theElement )

Required Arguments

  • theElement: The element. The Elements it checks: (Still Checking)
    • Player
    • Ped
    • Vehicle

Returns

Returns float as radius, false otherwise.

Example

This example shows how to get the radius of a player

function myCommandHandler(command)
	local myradius = getElementRadius ( getLocalPlayer() )
	if (myradius) then
		outputChatBox("Radius of my player is: " .. myradius)
	else
		outputChatBox("Error")
	end	
end

addCommandHandler("getmyradius", myCommandHandler)

See Also