Vehicle::setNeonColor

From RAGE Multiplayer Wiki
Revision as of 19:36, 20 October 2019 by M4xf0x (talk | contribs) (Created page with "This function is used to set the neon lights of a vehicle. == Syntax == <syntaxhighlight lang="javascript"> vehicle.setNeonColor(int r, int g, int b) </syntaxhighlight> == Arg...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This function is used to set the neon lights of a vehicle.

Syntax

vehicle.setNeonColor(int r, int g, int b)

Arguments

  • r: Red Value 0 - 255.
  • g: Green Value 0 - 255.
  • b: Blue Value 0 - 255.

Example

This example sets yellow neon lights for the vehicle, in which the player sits.

mp.events.add('playerCommand', (player, cmd) => {
    let arr = cmd.split(' ');
    if (arr[0] == 'neon' && player.vehicle) {
        player.vehicle.setNeonColor(255, 255, 0);
    }
});