Switch emergency lights from another script
Example for dispatch or garage using the server exports.
Turn a vehicle on for a call
local function startEmergencyRun(netId)
local vehicle = NetworkGetEntityFromNetworkId(netId)
if vehicle == 0 then
return
end
exports.lumina_els:setVehicleState(vehicle, { lights = true, siren = true, tone = 'wail' })
end
The vehicle needs an ELS profile and tone must exist in that profile. Otherwise the call raises an error.
Turn off when parking
exports.lumina_els:resetVehicle(vehicle)
Security
Do not call these exports from a client event without checks. Verify in your own script that the player is allowed to and really uses the vehicle.
All exports are listed under API.