Vehicle::getNeonColour: Difference between revisions

From RAGE Multiplayer Wiki
(Updated example section to use "<pre>" tags instead of incorrect syntax highlighting.)
(Updated formatting to correct wiki style.)
Line 1: Line 1:
__NOTOC__
{{ServersideJsFunction}}
This function used for get vehicle neon color in RGB format.
This function used for get vehicle neon color in RGB format.


{{JSContainer|
==Syntax==
==Syntax==
<syntaxhighlight lang="typescript">
<pre>
Object vehicle.getNeonColour();
Object vehicle.getNeonColour();
</syntaxhighlight>  
</pre>  
===Returns===
===Returns===
Return array containing colours.
Return array containing colours.
Line 25: Line 28:
);
);
</pre>
</pre>
}}
}}
}}


==See Also==
==See Also==
{{Vehicle_block}}
{{Vehicle_block}}

Revision as of 19:57, 11 September 2020

Server-Side
Function

 JavaScript



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

JavaScript Syntax

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

Server-Side
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