M MY Multiplayer: Wiki
Side
Kind

setVehicleHeadLightColor

Shared

Changes the colour of a vehicle's headlights.

bool setVehicleHeadLightColor(element vehicle, color color)

Parameters

NameTypeDescription
vehicleelementThe vehicle, or a parent element whose vehicles all change.
colorcolorThree numbers r, g, b (integers from 0 to 255) or a tocolor value. Alpha is ignored.

Returns

true if the colour was applied, false if the element is not a vehicle.

Given a parent element such as root, it applies to every vehicle below it, but the value returned is the element's own: false when it is not a vehicle.

Example

addCommandHandler("xenon", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle then
        setVehicleHeadLightColor(vehicle, 170, 200, 255)
    end
end)

See also