- Documentation
- Server functions
- setVehicleHeadLightColor
Function
setVehicleHeadLightColor
Changes the colour of a vehicle's headlights for every player, e.g. xenon blue or yellow. It affects the glowing lenses and the light patch in front of the car.
Syntax
bool setVehicleHeadLightColor(vehicle vehicle, int r, int g, int b)Arguments
vehiclevehicle- The vehicle.
rint- Red 0-255.
gint- Green 0-255.
bint- Blue 0-255.
Returns
true on success.
Example
addCommandHandler("ksenony", function(player)
local vehicle = getPedOccupiedVehicle(player)
if vehicle then setVehicleHeadLightColor(vehicle, 170, 200, 255) end
end)
See also
getVehicleHeadLightColorReturns the headlight colour (white 255, 255, 255 by default).setVehicleTailLightColorChanges the colour of a vehicle's tail lights for every player (red by default).setVehicleOverrideLightsForces the state of a vehicle's lights for every player. In Trilogy Hub the game does not switch the lights on at dusk by itself, so the headlights only shine after setting 2. Single lamps (brake, reverse, indicators) are set withsetVehicleLampState.