Vehicle::setModColor1: Difference between revisions

From RAGE Multiplayer Wiki
(yay)
 
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
paintType:<br>0: Normal<br>1: Metallic<br>2: Pearl<br>3: Matte<br>4: Metal<br>5: Chrome<br><br>color: number of the color.<br><br>p3 seems to always be 0.
{{ClientsideJsEvent}}
==Syntax==
Changes the primary color type and color of the given vehicle
<syntaxhighlight lang="javascript">vehicle.setModColor1(paintType, color, p3);</syntaxhighlight>
==MOD_COLOR_TYPE==
=== Required Arguments ===
{{JSContainer|
*'''paintType:''' int
//List of color types
*'''color:''' int
<pre>
*'''p3:''' int
const MOD_COLOR_TYPE = {
===Return value===
    MCT_METALLIC: 0,
*'''Undefined'''
    MCT_CLASSIC: 1,
==Example==
    MCT_PEARLESCENT: 2,
<syntaxhighlight lang="javascript">
    MCT_MATTE: 3,
// todo
    MCT_METALS: 4,
    MCT_CHROME: 5,
    MCT_CHAMELEON: 6 // only available on Gen9 platforms
    MCT_NONE: 7 // if this is set, the vehicle doesn't use mod colors, it uses the regular color system
};
</pre>
{{Parameters}}
* '''colorType''': {{RageType|Number}}
* '''color''': {{RageType|Number}} [[https://wiki.rage.mp/index.php?title=Vehicle_Colors List of Vehicle Colors]]
* '''pearlescentColor''': {{RageType|Number}}
 
{{Returns}}
*'''void'''
 
Pearlescent Color seems to always be 0 in the scripts.
 
{{Example}}
<syntaxhighlight lang="JavaScript" style="width: 98%;">
mp.players.local.vehicle.setModColor1(0, 44, 0); //change primary color of the vehicle to metallic bright red
</syntaxhighlight>
</syntaxhighlight>
}}
==See also==
==See also==
{{Vehicle_function_c}}
{{Vehicle_function_c}}
[[Category:Clientside API]]
[[Category:Clientside API]]
[[Category:TODO: Example]]
[[Category:TODO: Example]]

Latest revision as of 21:03, 2 March 2024

Client-Side
Event

 JavaScript



Changes the primary color type and color of the given vehicle

MOD_COLOR_TYPE

JavaScript Syntax

//List of color types

const MOD_COLOR_TYPE = {
    MCT_METALLIC: 0,
    MCT_CLASSIC: 1,
    MCT_PEARLESCENT: 2,
    MCT_MATTE: 3,
    MCT_METALS: 4,
    MCT_CHROME: 5,
    MCT_CHAMELEON: 6 // only available on Gen9 platforms
    MCT_NONE: 7 // if this is set, the vehicle doesn't use mod colors, it uses the regular color system
};

Parameters

Returns

  • void

Pearlescent Color seems to always be 0 in the scripts.

Example

mp.players.local.vehicle.setModColor1(0, 44, 0); //change primary color of the vehicle to metallic bright red


See also