Vehicle::getNeonColour: Difference between revisions

From RAGE Multiplayer Wiki
No edit summary
No edit summary
Line 15: Line 15:
That's example just show, how use it.
That's example just show, how use it.


<syntaxhighlight lang="javascript">
<syntaxhighlight lang="javascript" highlight="5">
mp.events.addCommand(`neonich`,  
mp.events.addCommand(`neonich`,  
(player) => {
(player) => {

Revision as of 15:24, 26 September 2017

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

That's example just show, how use it.

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