M MY Multiplayer: Wiki
Side
Kind

setVehicleNeonEnabled

Shared

Turns neon strips under a vehicle on or off.

bool setVehicleNeonEnabled(element element, int|string|table strips, bool enabled)

Parameters

NameTypeDescription
elementelementA vehicle, or a parent element: every vehicle below it changes too.
stripsint|string|tableOne strip by name or number (from 0), "all" or -1 for every strip, or a table of several.
enabledboolTurn on or off.

Returns

true if it changed, false if one of the strips does not exist on the vehicle (nothing changes on it).

Each strip is a rectangular light facing down. The strips come from the vehicle's model; getVehicleNeonStrips lists their names. On the server, the change is sent to every client. On the client, it applies to this client only.

Example

addCommandHandler("neon", function(player)
    local vehicle = getPedOccupiedVehicle(player)
    if vehicle then
        setVehicleNeonColor(vehicle, 0, 200, 255)
        setVehicleNeonEnabled(vehicle, "all", true)
    end
end)
NoteWith a parent element (such as root), every vehicle below changes, but the return value is the element's own, which is not a vehicle: false.

See also