VehicleClient

setVehicleXenonLightColorIndex

SET_VEHICLE_XENON_LIGHT_COLOR_INDEX0xE41033B25D003A07

The GTA V native SET_VEHICLE_XENON_LIGHT_COLOR_INDEX of the VEHICLE namespace, as LS:MP client scripts call it: the global function setVehicleXenonLightColorIndex, in JavaScript and in Lua.

SignatureJavaScript
setVehicleXenonLightColorIndex(vehicle: Vehicle, colorIndex: number): void
SignatureLua
setVehicleXenonLightColorIndex(vehicle: Vehicle, colorIndex: integer)

Usage

JavaScript
setVehicleXenonLightColorIndex(vehicle, colorIndex);
Lua
setVehicleXenonLightColorIndex(vehicle, colorIndex)

Parameters

ParameterTypeJavaScriptLua
vehicleVehiclenumberinteger
colorIndexintnumberinteger

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

color: is the paint index for the vehicle.
Paint index goes from 0 to 12.
Be aware that it only works on xenon lights. Example: https://i.imgur.com/yV3cpG9.png
Full list of all vehicle xenon lights by DurtyFree https://github.com/DurtyFree/gta-v-data-dumps/blob/master/vehicleColors.json

Reference

Namespace
Vehicle VEHICLE
In the game
void SET_VEHICLE_XENON_LIGHT_COLOR_INDEX(Vehicle vehicle, int colorIndex)
Hash
0xE41033B25D003A07
Introduced
Game build 1604 legacy numbering
Formerly
_SET_VEHICLE_HEADLIGHTS_COLOUR _SET_VEHICLE_XENON_LIGHTS_COLOUR _SET_VEHICLE_XENON_LIGHTS_COLOR

Open in the interactive natives reference