Vehicle::getNeonColour

From RAGE Multiplayer Wiki
Revision as of 19:47, 11 September 2020 by SugarD-x (talk | contribs) (Updated the example section's text to be grammatically correct.)

This function used for get vehicle neon color in RGB format.

Syntax

Object vehicle.getNeonColour();

Returns

Return array containing colours.

Array content

  • Red color in diapason 0 - 255.
  • Green color in diapason 0 - 255.
  • Blue color in diapason 0 - 255.

Example

An example showing the function's use.

mp.events.addCommand(`neonich`, 
	(player) => {
		let vehicle = player.vehicle;
		if (!!vehicle) {
			let [r, g, b] = vehicle.getNeonColour();
			player.outputChatBox(`R <b>${r}</b>; G <b>${g}</b>; B <b>${b}</b>`);
		};
	}
);

See Also

Template:Vehicle block