Vehicle::getNeonLightsColour: Difference between revisions

From RAGE Multiplayer Wiki
m (written a example for this!)
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Gets the color of the neon lights of the specified vehicle.<br><br>See _SET_VEHICLE_NEON_LIGHTS_COLOUR (0x8E0A582209A62695) for more information
Gets the color of the neon lights of the specified vehicle.
 
==Syntax==
==Syntax==
<syntaxhighlight lang="javascript">vehicle.getNeonLightsColor(r, g, b); //EDITED because of spelling mistake. it's called color not colour! </syntaxhighlight>
<pre>vehicle.getNeonLightsColour(r, g, b);</pre>
 
=== Required Arguments ===
=== Required Arguments ===
*'''r:''' int
*'''r:''' int
*'''g:''' int
*'''g:''' int
*'''b:''' int
*'''b:''' int
===Return value===
===Return value===
*'''object:''' r, g, b
*'''object:''' r, g, b
==Example==
==Example==
<syntaxhighlight lang="javascript">
<pre>
 
let obj = mp.players.local.vehicle.getNeonLightsColour(1, 1, 1);
//This command returns the color of the neon if its build in.
mp.gui.chat.push(`${obj.r} ${obj.g} ${obj.b}`);
</pre>


mp.events.addCommand("neontest", (player) => {
let vehicle = player.vehicle;
        if (!!vehicle) {
let [r, g, b] = vehicle.getNeonColor();
player.outputChatBox(`R <b>${r}</b>; G <b>${g}</b>; B <b>${b}</b>`);
};
});
</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 04:38, 27 February 2019

Gets the color of the neon lights of the specified vehicle.

Syntax

vehicle.getNeonLightsColour(r, g, b);

Required Arguments

  • r: int
  • g: int
  • b: int

Return value

  • object: r, g, b

Example

let obj = mp.players.local.vehicle.getNeonLightsColour(1, 1, 1);
mp.gui.chat.push(`${obj.r} ${obj.g} ${obj.b}`);

See also