GetRadarAreaColor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 4: Line 4:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
int int int int getRadarAreaColor ( radararea radararea )               
int int int int getRadarAreaColor ( radararea theRadararea )               
</syntaxhighlight>  
</syntaxhighlight>  


===Required Arguments===  
===Required Arguments===  
*'''radararea:''' The radar area you wish to retrieve the colour of
*'''theRadararea:''' The radar area you wish to retrieve the colour of


===Returns===
===Returns===
Returns four integers in RGBA format, with a maximum value of 255 for each.  Each stands for ''red'', ''green'', ''blue'', and ''alpha''.  Alpha decides transparancy where 255 is opaque and 0 is transparent.  ''false'' is returned if the blip is invalid.
Returns four integers in RGBA format (''red'', ''green'', ''blue'', ''alpha''), with a maximum value of 255 for each.  Alpha decides transparancy where 255 is opaque and 0 is transparent.  Returns ''false'' if the radararea is invalid.


==Example==  
==Example==  

Revision as of 22:47, 10 September 2006

This function can be used to retrieve the current color of a Radar Area.

Syntax

int int int int getRadarAreaColor ( radararea theRadararea )              

Required Arguments

  • theRadararea: The radar area you wish to retrieve the colour of

Returns

Returns four integers in RGBA format (red, green, blue, alpha), with a maximum value of 255 for each. Alpha decides transparancy where 255 is opaque and 0 is transparent. Returns false if the radararea is invalid.

Example

This example checks the color of a radararea defined as 'area' and announces if it is ballas or grove street.

local r,g,b,a = getRadarAreaColor ( area ) --get the color of 'area' and define it as 'r', 'g', 'b' and 'a'
if g == 255 then --if the radar area is fully green
    outputChatBox ( "This is Grove Street turf!" ) --announce it as grove street area
elseif r == 255 then --if it is fully red however
    outputChatBox ( "This is Ballas turf!" ) --announce it as ballas area
end

See Also