Vehicle::getNeonLightsColour: Difference between revisions

From RAGE Multiplayer Wiki
m (vehicle.getNeonLightsColour(r, g, b); changed to vehicle.getNeonLightsColor(r, g, b); REASON: Error in console because its called Color not Colour)
m (written a example for this!)
Line 10: Line 10:
==Example==
==Example==
<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript">
// todo
 
//This command returns the color of the neon if its build in.
 
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>
</syntaxhighlight>
==See also==
==See also==

Revision as of 19:25, 4 February 2019

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

See _SET_VEHICLE_NEON_LIGHTS_COLOUR (0x8E0A582209A62695) for more information

Syntax

vehicle.getNeonLightsColor(r, g, b); //EDITED because of spelling mistake. it's called color not colour!

Required Arguments

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

Return value

  • object: r, g, b

Example

//This command returns the color of the neon if its build in.

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>`);
	};
});

See also