isInsideRadarArea | Multi Theft Auto: Wiki Skip to content

isInsideRadarArea

Client-side
Server-side
Shared

Manual Review Required

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


This function checks if a 2D position is inside a radar area or not.

OOP Syntax Help! I don't understand this!

Syntax

bool isInsideRadarArea ( radararea theArea, float posX, float posY )
Required Arguments
  • theArea: The radar area you're checking the position against.
  • posX: The X coordinate of the position you're checking.
  • posY: The Y coordinate of the position you're checking.

Returns

  • bool: value

Returns true if the position is inside the radar area, false if it isn't or if any parameters are invalid.

Code Examples

shared

This function checks if an element is within a radar area.

function isElementInsideRadarArea ( theElement, theArea )
-- get the x, y coordinates from getElementPosition (z gets silently discarded)
local posX, posY = getElementPosition( theElement )
-- call isInsideRadarArea with those coordinates and return its result
return isInsideRadarArea ( theArea, posX, posY )
end