Skip to content

AutLaaw/al_lightbars

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

al_lightbars

al_lightbars is a lightbar, siren, and airhorn resource that has support for custom attached lightbars that support the new GTA lightbar mod option.

It supports:

  • attached lightbar objects
  • synced emergency lights
  • synced script sirens
  • synced airhorn
  • per-model siren overrides
  • per-lightbar siren overrides

Requirements

  • ox_lib

Default controls

  • Q = toggle emergency lights
  • Left Alt = toggle siren on/off
  • R = cycle siren tone, or temporary wail when siren is off
  • E = airhorn

All of these are configurable in shared/config.lua.

Blocking keypresses

Emergency keybinds (lights, siren toggle, tone / temp wail, airhorn) are ignored while sirenKeysBlocked() is true. This can be changed in client/keybinds.lua

Config (shared/config.lua)

Option What it does
useAttachedLightbarObjects Spawn roof lightbar objects for custom lightbar IDs (ONX support). false = siren/audio only, no objects.
checkIntervalSpeed ms between main loop ticks while you have at least one lightbar object attached.
lightbarScanInterval / lightbarScanRange How often / how far to scan for other vehicles that need a lightbar object.
sirenCycleTurnsOn true: Lights on, siren off: true = pressing R turns the siren on and cycles the tone once. false: same case = hold R temp wail. With siren already on, R still cycles tone.
sirenShutOff Driver exits seat, then siren + airhorn gets shut off.
muteSirenWhenAirhorn While airhorn is held, siren audio is muted.
useEngineHealth / damagedSiren Below threshold = broken siren sound; which health to use.
keybinds / keyFeedback Input mapper names + optional sound feedback on press.
lightbarModels Slot 49 mod index (Lightbar customisation mod option), object model hash (ONX defaults in repo config).
sirenConfig.sounds Master list: name + siren audio name; optional ref / bank for add-on packs.
sirenConfig.profiles Named sets (POLICE, AMBULANCE, …): sirens = tone order (names from sounds), horn = which sounds entry for airhorn.
sirenConfig.overrides Map vehicle model hashprofiles key (e.g. ambulance models = "AMBULANCE").
sirenConfig.lightbarOverrides Lightbar mod index → profile key (same indices as lightbarModels when using that system).

Replacing onx-evp-b-lightbars (If you don't use ONX's lightbar system / pack, then ignore this part)

al_lightbars can replace the scripted behavior from onx-evp-b-lightbars.

To make this compatible with ONX's resource:

  • keep the ONX resource for models / meta / stream files
  • remove the ONX Lua logic
  • al_lightbars will then handle lights, sirens, airhorn and lightbar vehicle objects

Recommended setup

  1. Keep onx-evp-b-lightbars as an asset-only resource
  2. Remove client, server, and shared script folders from the ONX resource
  3. Keep only the streamed assets and the data folder, along with the version.lua
  4. Start onx-evp-b-lightbars before al_lightbars.

Expected ONX layout after removing the extra files:

onx-evp-b-lightbars/
├── data/
│   ├── handling.meta
│   ├── vehicles.meta
│   └── carvariations.meta
├── stream/
├── .fxap
└── fxmanifest.lua
└── version.lua

Example asset-only + version.lua check fxmanifest.lua for onx-evp-b-lightbars:

fx_version 'cerulean'
game 'gta5'
author 'ONX'
description 'WiseGuy Emergency Vehicles Pack Lightbars'
version '1.3.0'
lua54 'yes'

data_file 'HANDLING_FILE' 'data/handling.meta'
data_file 'VEHICLE_METADATA_FILE' 'data/vehicles.meta'
data_file 'VEHICLE_VARIATION_FILE' 'data/carvariations.meta'

files {
  'data/*.meta'
}

client_scripts {
  'data/vehicle_names.lua',
}

server_scripts {
  'version.lua',
}

escrow_ignore {
  'data/*.meta',
  'stream/*.ytd',
  'data/*.lua',
}

dependency '/assetpacks'

Resource start order:

ensure ox_lib
ensure onx-evp-b-lightbars
ensure al_lightbars

Notes

  • This resource supports vehicles using the new lightbar mod customisation slot for lightbars.

  • If useAttachedLightbarObjects is disabled, the siren system still works like normal, but that will disable the support for the custom lightbar models spawned.

  • Support: questions and bug reports - AutLaaw Discord

Credits

  • Some logic was inspired / taken from Renewed-Sirensync, credits goes to the maintainers of that resource.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Sponsor this project

Packages

Contributors

Languages