Server dev / extending
This page is aimed at server developers who want to integrate hm_ELSPlus into other scripts or extend it.
Exports (client and server)
Section titled “Exports (client and server)”| Export | Returns |
|---|---|
IsElsVehicle(vehicle) | true if the vehicle has an ELS or attachment config |
IsBlueLightActive(vehicle) | true if the emergency lights are on |
HasNoFlashConfig(vehicle) | true if “Ignored by speed cameras” is set for the vehicle |
IsNoFlashActive(vehicle) | true if NoFlash is set and the emergency lights are on |
From version 1.9.3 additionally, on the client only:
| Export | Returns |
|---|---|
IsHotbarGesperrt() | true while the hotbar lock is active for your own player (they are sitting in an ELS vehicle and the server mod is on) |
NoFlash
Section titled “NoFlash”For speed camera and radar scripts:
local function shouldFlash(vehicle) if GetResourceState('hm_ELSPlus') == 'started' and exports['hm_ELSPlus']:IsNoFlashActive(vehicle) then return false end return trueendState bags
Section titled “State bags”All states are stored as state bags on the vehicle and can be read on client and server:
| State bag | Meaning |
|---|---|
els_primary, els_ppl, els_secondary, els_tertiary | Emergency lights, PPL, front flashers, 3rd beacon |
els_rearWarning, els_scene, els_interior, els_trauma | Rear warning, scene light, interior, trauma |
els_matrix, els_matrix2, els_matrix3 | Matrix displays |
els_estelle, els_kennleuchte | Incident scene (E-Stelle), beacon mounted |
els_siren_1, els_siren_2, els_siren_3 | Siren tones |
els_pattern_index | Active pattern level (1–3) |
els_att_mode | Light colour of the attachments (blue / orange) |
elsAttachments | List of spawned attachments on the carrier vehicle |
isElsPlusAttachment | On the attachment itself: true if the entity is an ELS attachment (see Reading attachments) |
local st = Entity(vehicle).stateif st.els_primary and st.els_siren_1 then -- emergency run with tone 1endThere is no dedicated siren export; the siren state bags are sufficient for that.
Events
Section titled “Events”| Event | Side | Parameters |
|---|---|---|
hm_ELSPlus:estelle | Client | on, netId, vehicle – incident scene mode was toggled |
hm_ELSPlus:estelle | Server | source, netId, on |
HM_ELSPlus:hotbarSperre | Client | gesperrt (true/false) – from 1.9.3: the hotbar lock turns on (getting into an ELS vehicle) or off |
With the hotbar event another inventory can switch off its own quick slots in ELS vehicles (ELS Plus locks ox_inventory directly):
AddEventHandler('HM_ELSPlus:hotbarSperre', function(gesperrt) -- lock your own hotbar (true) or release it again (false)end)You create your own control panel buttons and events without code under Templates → Actions & events. Client events receive netId, vehicle, server events source, netId.
Config files
Section titled “Config files”config/├─ einstellungen.lua settings from Server Mods → Server Settings and Templates (colours, groups) – takes precedence├─ sirens.lua siren system, WM-Sirens, GTA tones, OISS presets (Templates → Siren packs)├─ main.lua base values: keys, groups, control panels (ELSPlus.Skins), performance├─ patterns.lua base patterns (steady, off) and base colours├─ fahrzeuge/ ELS vehicles (one file per vehicle)├─ attachments/ attachment configs per model or licence plate├─ anbauteil_templates/ attachment templates├─ layouts/ control panel layouts├─ daten/ further editor data: aktionen, bedienteile, patterns, pattern_packs, pattern_groups,│ sirenen_profile, servermods, stromversorgung, absaugung (from 1.9.3), datenschreiber,│ rechte, streamdeck_profile├─ gebaeude/ from 1.9.3: building configs (one file per building), LIESMICH.txt, _export/ (export, backups)└─ intern/ maintained automatically, do not edit by hand: addon_registry, udr_berichte, backupslocales/ from 1.9.3: language files de.json, en.json and your ownAll files are written by the editor. The Lua files at the top are commented and may also be edited by hand.
Language files
Section titled “Language files”From version 1.9.3 all texts are in locales/<code>.json: a flat list "key": "Text"; placeholders are in curly braces (e.g. {name}) and must be kept when translating. If a key is missing in the chosen language, the text from de.json applies. If a file is not valid JSON, the server console reports it and German applies. Selection and your own language: Server mods → Language.
Shipping buildings with an MLO
Section titled “Shipping buildings with an MLO”From version 1.9.3 an MLO can ship its own building config. ELS Plus then loads it automatically, even if the MLO starts after ELS; if the MLO is stopped, the points disappear again.
- Set up the building in-game (Supply → + Building, set the room in game, place the points). ELS saves it as
config/gebaeude/<id>.json. - Copy the file into the MLO’s folder as
els_gebaeude.json. - Add this to the MLO’s
fxmanifest.lua:
els_gebaeude 'els_gebaeude.json'files { 'els_gebaeude.json' }Several buildings: several els_gebaeude lines, or a JSON array with several buildings in one file. In the tablet such buildings are read-only; admins switch them on or off or create a Local copy. The data format is described in config/gebaeude/LIESMICH.txt (German).
Sirens
Section titled “Sirens”In config/sirens.lua you choose the system:
ELSPlus.SirenSystem = "WM" -- WM-Sirens-- orELSPlus.SirenSystem = "ServerSided" -- OISS with presets (ELSPlus.SirenPresets)-- orELSPlus.SirenSystem = "GTA" -- GTA V sirens from the game, without a sound packYou set the tones per vehicle in the editor or via siren profiles. With OISS, the audio resource must be started.
GTA V sirens (without a sound pack)
Section titled “GTA V sirens (without a sound pack)”The category GTA V (no sound pack) is available in the editor with every system (wail, yelp, warnings, fire department, air horn and more, list in ELSPlus.GTA). These tones come directly from the game and need no audio resource. Players who have siren mods installed client-side (replaced GTA sounds) hear their own tones.
Troubleshooting
Section titled “Troubleshooting”- Nothing is saved: check write permissions on
config/(File permissions). - Vehicle is not recognised: enter the spawn name instead of the
gameName. - Debug output:
ELSPlus.Debug = trueinconfig/main.lua, then restart the resource. els_reload_configsin the server console reloads vehicle configs without a restart.- Cable or exhaust hose white or without colour (from 1.9.3):
els_seilcheckin the server console or the system check, see Installation, step 7. - Action is rejected: if something legitimate is rejected, see Server mods → Security.