Skip to content
This page was translated from German using AI. If anything is unclear, the German version applies.

Server dev / extending

This page is aimed at server developers who want to extend hm_ELSPlus or integrate it into other scripts.

  1. Make changes in config/*.lua or the vehicle JSON.
  2. Run els_reload_configs on the server (without a full restart).
  3. Respawn the vehicle and test the functions in-game.
  4. For UI problems, use /els_editor_fix.

The base configuration is in config/sirens.lua. There you choose between two systems:

The simplest mode — uses the standard FiveM sirens or WM sound packs.

ELSPlus.SirenSystem = "WM"
ELSPlus.WM = {
defaultTones = { [1]="SIREN_ALPHA", [2]="SIREN_BRAVO", [3]="SIREN_CHARLIE" },
soundset = "DLC_WMSIRENS_SOUNDSET",
audioBank = "DLC_WMSIRENS\\SIRENPACK_ONE"
}
  • defaultTones: the 3 tones assigned to keys 1/2/3 by default.
  • soundset: the GTA soundset (must match the installed mod).
  • audioBank: the audio bank that is loaded (string, not a table).

With OISS, sirens are configured via named presets. Each preset bundles soundset, audio bank, available tones and horn.

ELSPlus.SirenSystem = "ServerSided"
-- default preset for new vehicles (must exist in SirenPresets)
ELSPlus.DefaultPreset = "LSPD Modern"
ELSPlus.SirenPresets = {
["LSPD Modern"] = {
soundset = "oiss_ssa_vehaud_lspd_new_soundset",
audioBank = "DLC_SERVERSIDEAUDIO\\OISS_SSA_VEHAUD_LSPD_NEW",
tones = {
"oiss_ssa_vehaud_lspd_new_siren_adam",
"oiss_ssa_vehaud_lspd_new_siren_boy",
"oiss_ssa_vehaud_lspd_new_siren_charles",
"oiss_ssa_vehaud_lspd_new_siren_david",
"oiss_ssa_vehaud_lspd_new_siren_edward",
},
horn = "oiss_ssa_vehaud_lspd_new_horn",
},
["BCSO Modern"] = {
soundset = "oiss_ssa_vehaud_bcso_new_soundset",
audioBank = "DLC_SERVERSIDEAUDIO\\OISS_SSA_VEHAUD_BCSO_NEW",
tones = { ... },
horn = "oiss_ssa_vehaud_bcso_new_horn",
},
-- more presets: LSSD, SAHP, NOOSE, FIB, RHPD, DPPD, LSIA,
-- LSPP, LSFD, LSCOFD, BCFD, SanFire, SAMS, USFS, other
-- each in modern and vintage variants
}

Important:

  • Tone names are department-specific! e.g. oiss_ssa_vehaud_lspd_new_siren_adam (not oiss_ssa_vehaud_siren_adam).
  • Each preset has: soundset, audioBank (string), tones (array of all tones), horn.
  • In the editor the player chooses a preset by name — the matching tones are offered automatically.
  • ELSPlus.DefaultPreset determines which preset new vehicles get.
  • The OISS resource must be started (source: github.com/fk-1997/Server-Sided-Sounds-and-Sirens).

Backwards compatibility: ELSPlus.ServerSided is generated automatically from the DefaultPreset. Old code that reads ELSPlus.ServerSided.soundset or .defaultTones keeps working.

In the vehicle JSON, a different preset/tones can be set per vehicle:

{
"spawnName": "police2",
"siren": {
"wmTones": [
"oiss_ssa_vehaud_lspd_new_siren_adam",
"oiss_ssa_vehaud_lspd_new_siren_boy",
"oiss_ssa_vehaud_lspd_new_siren_charles"
],
"tonePresets": ["LSPD Modern", "LSPD Modern", "LSPD Modern"],
"range": 500
}
}
  • wmTones: the 1-3 tone names for the siren keys.
  • tonePresets (OISS only): assigns the preset to each slot (so the editor knows which soundset/bank to load).
  • range: audible range in metres.
  • Older configs with siren.soundset are still supported as well.

The setting is per vehicle in the JSON config:

{
"spawnName": "police2",
"noFlash": true
}

Behaviour:

  • noFlash: true on its own is not enough.
  • Protection applies when the emergency lights are on and noFlash is active.

hm_ELSPlus provides exports you can use directly in speed camera or radar scripts:

  • IsNoFlashActive(vehicle) -> true if the emergency lights are on and NoFlash is set.
  • IsBlueLightActive(vehicle) -> true if the primary light is on.
  • IsElsVehicle(vehicle) -> true if the vehicle has an ELS/attachment config.
  • HasNoFlashConfig(vehicle) -> true if the config has noFlash set.

Minimal example:

local function shouldFlash(vehicle)
if GetResourceState("hm_ELSPlus") ~= "started" then
return true
end
if exports["hm_ELSPlus"]:IsNoFlashActive(vehicle) then
return false
end
return true
end

For diagnostics or your own logic you can read state bags directly:

local state = Entity(vehicle).state
local primary = state["els_primary"] == true
local rearWarning = state["els_rearWarning"] == true
local siren1 = state["els_siren_1"] == true

Note: state bags show the live state, but not the full vehicle configuration.

  • /els_config - open the editor
  • /els_editor_fix - reset the UI
  • /els_env_debug - env light debug
  • els_reload_configs - reload vehicle configs
  • els_debug_layouts - debug layouts
  • Set write permissions on config/ correctly (see File permissions, otherwise nothing is saved).
  • With ServerSided sirens, check that the audio resource is really started.
  • After structural changes, always test with several vehicle types (ELS + attachment).