Vehicle::getColorRGB: Difference between revisions

From RAGE Multiplayer Wiki
 
(One intermediate revision by one other user not shown)
Line 3: Line 3:
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
Array vehicle.getColourRGB(int slot);
Array vehicle.getColorRGB(int slot);
</syntaxhighlight>  
</syntaxhighlight>  


Line 11: Line 11:
==Example==  
==Example==  
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
let primaryColor = vehicle.getColourRGB(0);
let primaryColor = vehicle.getColorRGB(0);
let secondaryColor = vehicle.getColourRGB(1);  
let secondaryColor = vehicle.getColorRGB(1);  
// primaryColor output: [ 255, 0, 0 ]
// primaryColor output: [ 255, 0, 0 ]
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 16:48, 15 January 2018

This function used to get the vehicle RGB body color. Returns null if never set explicitly.

Syntax

Array vehicle.getColorRGB(int slot);

Required Arguments

  • slot: The color you want to get. (valid is 0 or 1)

Example

let primaryColor = vehicle.getColorRGB(0);
let secondaryColor = vehicle.getColorRGB(1); 
// primaryColor output: [ 255, 0, 0 ]

See Also

Template:Vehicle block