Vehicle::setColorRGB: Difference between revisions

From RAGE Multiplayer Wiki
(Example)
 
(One intermediate revision by one other user not shown)
Line 7: Line 7:


===Required Arguments===
===Required Arguments===
*'''r1:''' Primary red color in diapason 0 - 255.
*'''r1''': {{RageType|Int}} Primary Red Colour [0 - 255]
*'''g1:''' Primary green color in diapason 0 - 255.
*'''g1''': {{RageType|Int}} Primary Green Colour [0 - 255]
*'''b1:''' Primary blue color in diapason 0 - 255.
*'''b1''': {{RageType|Int}} Primary Blue Colour [0 - 255]
*'''r2:''' Secondary red color in diapason 0 - 255.
*'''r2''': {{RageType|Int}} Secondary Red Colour [0 - 255]
*'''g2:''' Secondary green color in diapason 0 - 255.
*'''g2''': {{RageType|Int}} Secondary Green Colour [0 - 255]
*'''b2:''' Secondary blue color in diapason 0 - 255.
*'''b2''': {{RageType|Int}} Secondary Blue Colour [0 - 255]


<syntaxhighlight lang="javascript">
===Example===
let rgb1 = [215, 142, 16];
{{ServersideCode|
let rgb2 = [240, 240, 240];
<pre>
vehicle.setColorRGB(rgb1[0], rgb1[1], rgb1[2], rgb2[0], rgb2[1], rgb2[2]);
// Sets yellow to the primary color, and white for the secondary color
</syntaxhighlight>
vehicle.setColorRGB(215, 142, 16, 250, 250, 250);
</pre>
}}

Latest revision as of 04:41, 22 April 2020

This function used for set vehicle RGB body color.

Syntax

void vehicle.setColorRGB(int r1, int g1, int b1, int r2, int g2, int b2);

Required Arguments

  • r1: Int Primary Red Colour [0 - 255]
  • g1: Int Primary Green Colour [0 - 255]
  • b1: Int Primary Blue Colour [0 - 255]
  • r2: Int Secondary Red Colour [0 - 255]
  • g2: Int Secondary Green Colour [0 - 255]
  • b2: Int Secondary Blue Colour [0 - 255]

Example

Server-Side
// Sets yellow to the primary color, and white for the secondary color
vehicle.setColorRGB(215, 142, 16, 250, 250, 250);