createRadarArea
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 can be used to create custom radar areas on the radar.
OOP Syntax Help! I don't understand this!
- Constructor: RadarArea(...)
Syntax
radararea createRadarArea ( float startPosX, float startPosY, float sizeX, float sizeY, [ int r = 255, int g = 0, int b = 0, int a = 255 ] )Required Arguments
- startPosX: MISSING_PARAM_DESC
- startPosY: MISSING_PARAM_DESC
- sizeX: MISSING_PARAM_DESC
- sizeY: MISSING_PARAM_DESC
Optional Arguments
NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use.
- r (default: 255): MISSING_PARAM_DESC
- g (default: 0): MISSING_PARAM_DESC
- b (default: 0): MISSING_PARAM_DESC
- a (default: 255): MISSING_PARAM_DESC
Returns
- radararea: value
Code Examples
server
This example creates a radar area for the King of the hill script, and a colsquare. When the player enters the radar area it flashes, and stops flashing when a player leaves it.
-- create our hill area for our gamemodelocal hillArea = createColRectangle ( -2171.0678710938, 678.17950439453, 15, 15 )local hillRadar = createRadarArea ( -2183.5678710938, 705.67950439453, 40, -40, 0, 255, 0, 175 )
-- add hill_Enter as a handler for when a player enters the hill areafunction hill_Enter ( thePlayer, matchingDimension ) -- announce to everyone that the player entered the hill if (getElementType(thePlayer) == "player") then outputChatBox( getPlayerName(thePlayer) .. " entered the zone!", root, 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, true ) endendaddEventHandler ( "onColShapeHit", hillArea, hill_Enter )
-- add hill_Enter as a handler for when a player leaves the hill areafunction hill_Exit ( thePlayer, matchingDimension ) -- check if the player is not dead if (getElementType(thePlayer) == "player") then if isPedDead ( thePlayer ) ~= true then -- if he was alive, announce to everyone that the player has left the hill outputChatBox ( getPlayerName(thePlayer) .. " left the zone!", root, 255, 255, 109 ) setRadarAreaFlashing ( hillRadar, false ) end endendaddEventHandler ( "onColShapeLeave", hillArea, hill_Exit )