Lumina Portal

Free to read, no accountVersion 4.0.1

API

Exports and state bags for dispatch, vehicle spawners and other scripts.

Server exports

ExportReturn 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.

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

FieldType
lights, siren, manual, horn, hornInterruptboolean
toneTone key from the profile of the vehicle

setVehicleState raises an error if the vehicle has no ELS profile or the patch contains invalid fields.

Client exports

client
local state = exports.lumina_els:getVehicleState(vehicle)
local lightsOn = exports.lumina_els:areLightsOn(vehicle)
local sirenOn = exports.lumina_els:isSirenOn(vehicle)

State bags

State bagContent
Entity(vehicle).state.luminaElsLights, siren, tone, horn, deployable light, revision
GlobalState.luminaElsCatalogTones, profiles, vehicles, audible range

Only the server writes these state bags. Use the server exports to change them.

Technology and performance

SituationWhat runs
No emergency lights nearby, not in an ELS vehicleNothing, no loop
Other emergency vehicles in rangeOne check per second over active vehicles only
You drive an ELS vehicleOne thread blocking the GTA keys
Custom siren audiblePositional audio at most 10× per second
Deployable light in sightOne thread drawing the light

Emergency vehicles only use the native lights of their carcols.meta, without extras and without drawn lights.