API
Exports and state bags for dispatch, vehicle spawners and other scripts.
Server exports
| Export | Return value or effect |
|---|---|
getVehicleState(vehicle) | Current state or nil |
setVehicleState(vehicle, patch) | Change the state |
resetVehicle(vehicle) | Turn off everything on the vehicle |
resetVehiclesInRadius(coords, radius) | Number of reset vehicles, of which GTA siren only |
getCatalog() | Tones, profiles, vehicles, audible range |
deployBeacon(vehicle, color) | Place a deployable light without item, lights off |
removeBeacon(vehicle) | Remove the deployable light |
vehicle is always the entity on the server.
exports.lumina_els:setVehicleState(vehicle, { lights = true, siren = true, tone = 'wail' })
local count, nativeCount = exports.lumina_els:resetVehiclesInRadius(vector3(0.0, 0.0, 0.0), 100.0)
Fields for setVehicleState
| Field | Type |
|---|---|
lights, siren, manual, horn, hornInterrupt | boolean |
tone | Tone key from the profile of the vehicle |
setVehicleStateraises an error if the vehicle has no ELS profile or the patch contains invalid fields.
Client exports
local state = exports.lumina_els:getVehicleState(vehicle)
local lightsOn = exports.lumina_els:areLightsOn(vehicle)
local sirenOn = exports.lumina_els:isSirenOn(vehicle)
State bags
| State bag | Content |
|---|---|
Entity(vehicle).state.luminaEls | Lights, siren, tone, horn, deployable light, revision |
GlobalState.luminaElsCatalog | Tones, profiles, vehicles, audible range |
Only the server writes these state bags. Use the server exports to change them.
Technology and performance
| Situation | What runs |
|---|---|
| No emergency lights nearby, not in an ELS vehicle | Nothing, no loop |
| Other emergency vehicles in range | One check per second over active vehicles only |
| You drive an ELS vehicle | One thread blocking the GTA keys |
| Custom siren audible | Positional audio at most 10× per second |
| Deployable light in sight | One thread drawing the light |
Emergency vehicles only use the native lights of their carcols.meta, without extras and without drawn lights.