Vehicle::getNeonColour: Difference between revisions

From RAGE Multiplayer Wiki
(Updated formatting to correct wiki style.)
(Added missing "See Also" links.)
Line 31: Line 31:
}}
}}


==See Also==
== See Also ==
{{Vehicle_block}}
*'''Server-side'''
{{Vehicle_function}}

Revision as of 19:58, 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