getRadarAreaSize | Multi Theft Auto: Wiki Skip to content

getRadarAreaSize

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 is used for getting the X and Y size of an existing radar area.

OOP Syntax Help! I don't understand this!

Syntax

float, ​float getRadarAreaSize ( ​radararea theRadararea )
Required arguments
  • theRadararea: The radar area element whose size you wish to get.

Returns

Returns two floats indicating the X and Y length of the radar area respectively, false if the radar area is invalid.

  • float: value1
  • float: value2

Code Examples

shared

The following example looks for radar areas whose size is smaller than 100 by 100:

local radarareas = getElementsByType ( "radararea" ) -- get a table of radararea elements
for k, theArea in ipairs(radarareas) do -- use a generic for loop to step through each of the elements
local sizeX, sizeY = getRadarAreaSize ( theArea ) -- get the size of the radar area
if ( sizeX < 100 and sizeY < 100 ) then -- check if it's smaller than 100 by 100
outputChatBox ( "A small radar area was found!" )
end
end