CreateRadarArea: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
[[Category:Incomplete]]
[[Category:Incomplete]]
__NOTOC__  
__NOTOC__  
This fake function is for use with blah & blah and does blahblahblabhalbhl
This function can be used to create custom radar areas on the radar.


==Syntax==  
==Syntax==  
Line 10: Line 9:


===Required Arguments===  
===Required Arguments===  
*'''argumentName:''' description
*'''x:''' A float representing the starting 'x' position of the radar area
*'''y:''' A float representing the starting 'y' position of the radar area
*'''sizex:''' A float representing the width of the radar area, going in an east direction
*'''sizey:''' A float representing the height of the radar area, going in a south direction
 
*'''r:''' An integer representing the amount of red in the color.  Maximum value is 255
*'''g:''' An integer representing the amount of green in the color.  Maximum value is 255
*'''b:''' An integer representing the amount of blue in the color.  Maximum value is 255
*'''a:''' An integer representing the amount of alpha in the color.  This allows setting the transparency of the radar area.  255 is opaque and 0 is transparent.


===Optional Arguments===  
===Optional Arguments===  
{{OptionalArg}}  
{{OptionalArg}}  
*'''argumentName2:''' descriptiona
*'''visibleto:''' An element or elements that you wish to restrict the visibility of the radar area to.
*'''argumentName3:''' description
 
===Returns===
Returns ''true'' if blah, ''false'' otherwise.


==Example==  
==Example==  
This example does...
This example creates a radar area when a player spawns, only if the player is in the 'grovestreet' team.
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
--This line does...
addEventHandler ( "onPlayerSpawn", root, "onPlayerSpawn" ) --add an event handler for onPlayerSpawn
blabhalbalhb --abababa
function onPlayerSpawn ( spawnpoint ) --when a player spawns
--This line does this...
    createRadarArea ( 0, 0, 5, 5, 0, 255, 0, 150, grovestreet ) --create a green radar area at 0, 0 which is only visible to the 'grovestreet' team
mooo
end
</syntaxhighlight>
</syntaxhighlight>


==See Also==
==See Also==
{{Radar area_functions}}
{{Radar area_functions}}

Revision as of 13:13, 14 August 2006


This function can be used to create custom radar areas on the radar.

Syntax

radararea createRadarArea ( float x, float y, float sizex, float sizey, int r, int g, int b, int a, [ visibleTo=getRootElement () ] )             

Required Arguments

  • x: A float representing the starting 'x' position of the radar area
  • y: A float representing the starting 'y' position of the radar area
  • sizex: A float representing the width of the radar area, going in an east direction
  • sizey: A float representing the height of the radar area, going in a south direction
  • r: An integer representing the amount of red in the color. Maximum value is 255
  • g: An integer representing the amount of green in the color. Maximum value is 255
  • b: An integer representing the amount of blue in the color. Maximum value is 255
  • a: An integer representing the amount of alpha in the color. This allows setting the transparency of the radar area. 255 is opaque and 0 is transparent.

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • visibleto: An element or elements that you wish to restrict the visibility of the radar area to.

Example

This example creates a radar area when a player spawns, only if the player is in the 'grovestreet' team.

addEventHandler ( "onPlayerSpawn", root, "onPlayerSpawn" ) --add an event handler for onPlayerSpawn
function onPlayerSpawn ( spawnpoint ) --when a player spawns
    createRadarArea ( 0, 0, 5, 5, 0, 255, 0, 150, grovestreet ) --create a green radar area at 0, 0 which is only visible to the 'grovestreet' team
end

See Also