Vehicle::setModColor2: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
No edit summary
 
Line 1: Line 1:
Changes the secondary paint type and color
{{ClientsideJsEvent}}
Changes the secondary color type and color of the given vehicle
==MOD_COLOR_TYPE==
==MOD_COLOR_TYPE==
{{JSContainer|
//List of color types
<pre>
<pre>
const MOD_COLOR_TYPE = {
const MOD_COLOR_TYPE = {
Line 13: Line 16:
};
};
</pre>
</pre>
{{Parameters}}
* '''colorType''': {{RageType|Number}}
* '''color''': {{RageType|Number}} [[https://wiki.rage.mp/index.php?title=Vehicle_Colors List of Vehicle Colors]]


color: number of the color
{{Returns}}
==Syntax==
*'''void'''
<syntaxhighlight lang="javascript">vehicle.setModColor2(paintType, color);</syntaxhighlight>
 
=== Required Arguments ===
{{Example}}
*'''paintType:''' int
<syntaxhighlight lang="JavaScript" style="width: 98%;">
*'''color:''' int
mp.players.local.vehicle.setModColor2(0, 44); //change secondary color of the vehicle to metallic bright red
===Return value===
*'''Undefined'''
==Example==
<syntaxhighlight lang="javascript">
// todo
</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:00, 2 March 2024

Client-Side
Event

 JavaScript



Changes the secondary 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

Example

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


See also