GetMarkerColor: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 1: Line 1:
__NOTOC__
__NOTOC__
==Description==
This function returns three [[int]]s corresponding to the amount of red, green and blue (respectively) in the marker's color. It can be useful for coloring objectives text to the same color as the marker.
This function returns three ints corresponding to the amount of red, green and blue (respectively) in the marker's color. It can be useful for coloring objectives text to the same color as the marker.


==Syntax==
==Syntax==
int int int [[getMarkerColor]] ( [[marker]] marker )
<syntaxhighlight lang="lua">int int int getMarkerColor ( marker myMarker )</syntaxhighlight>


This function also has three variants that allow you to retrieve data from just one of the three axes.
This function also has three variants that allow you to retrieve data from just one of the three axes.


int [[getMarkerColor|getMarkerColorRed]] ( [[marker]] marker )
<syntaxhighlight lang="lua">int getMarkerColor|getMarkerColorRed ( marker myMarker )</syntaxhighlight>


int [[getMarkerColor|getMarkerColorGreen]] ( [[marker]] marker )
<syntaxhighlight lang="lua">int getMarkerColor|getMarkerColorGreen ( marker myMarker )</syntaxhighlight>


int [[getMarkerColor|getMarkerColorBlue]] ( [[marker]] marker )
<syntaxhighlight lang="lua">int getMarkerColor|getMarkerColorBlue ( marker myMarker )</syntaxhighlight>


===Required Arguments===
===Required Arguments===
*'''marker''': The [[marker]] that you wish to retrieve the color of.
*'''marker''': The [[marker]] that you wish to retrieve the color of.
===Returns===
Returns three [[int]]s corresponding to the amount of red, green and blue (respectively) in the marker's color.


==Example==
==Example==
  newmarker = [[createMarker]] ( 1, 1000, 1000, 1000, 1,0,0 )
  <syntaxhighlight lang="lua">newMarker = createMarker ( 1, 1000, 1000, 1000, 1,0,0 )
   
   
  r,g,b = [[getMarkerColor]] ( newmarker )
  r,g,b = getMarkerColor ( newmarker )
  if (r) then
  if (r) then
   [[serverChat]] ( "Current marker color: ",r,",",g,",",b,"." )
   OutputChatBox ( ("Current marker color: ",r,",",g,",",b,"."), player )
  end
  end</syntaxhighlight>

Revision as of 16:48, 18 May 2006

This function returns three ints corresponding to the amount of red, green and blue (respectively) in the marker's color. It can be useful for coloring objectives text to the same color as the marker.

Syntax

int int int getMarkerColor ( marker myMarker )

This function also has three variants that allow you to retrieve data from just one of the three axes.

int getMarkerColor|getMarkerColorRed ( marker myMarker )
int getMarkerColor|getMarkerColorGreen ( marker myMarker )
int getMarkerColor|getMarkerColorBlue ( marker myMarker )

Required Arguments

  • marker: The marker that you wish to retrieve the color of.

Returns

Returns three ints corresponding to the amount of red, green and blue (respectively) in the marker's color.

Example

newMarker = createMarker ( 1, 1000, 1000, 1000, 1,0,0 )
 
 r,g,b = getMarkerColor ( newmarker )
 if (r) then
  OutputChatBox ( ("Current marker color: ",r,",",g,",",b,"."), player )
 end