Перейти к содержанию

Vehicle::setNeonColor

Материал из RAGE MP Wiki Archive
Версия от 19:36, 20 октября 2019; imported>M4xf0x (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...")
(разн.) ← Предыдущая версия | Текущая версия (разн.) | Следующая версия → (разн.)

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>

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. <syntaxhighlight lang="javascript"> mp.events.add('playerCommand', (player, cmd) => {

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

}); </syntaxhighlight>