Skip to content

Voice dispatch

Configuration

Everything is in lwk_control/config.lua. Restart lwk_control after a change.

Microphone

Config.MicMode 'ptt' | 'warm' (default: 'ptt')

  • 'ptt': the mic opens when you press the key, the click plays once it's live, and it stays open MicLingerMs after you let go.
  • 'warm': the mic stays open all session so the first syllable is never lost. Audio is only held in memory (PreRollMs) and never transcribed outside push-to-talk.

Config.MicLingerMs number (default: 10000)
Milliseconds the mic stays open after release in 'ptt' mode.

Config.PreRollMs number (default: 300)
Milliseconds of audio kept from before the key press.

Config.MicProcessing boolean (default: true)
The browser's noise suppression, echo cancellation and auto gain. Helps in noisy rooms, can hurt recognition otherwise. This is the default for players who haven't set it in /control.

Keys and commands

Config.PttKey string (default: 'h')
Hold to talk to dispatch.

Config.PaKey string (default: 'b')
Hold to speak through the PA.

Config.SettingsCommand string | false (default: 'control')
The settings panel command. false disables it.

Radio animation

Config.RadioAnimation boolean (default: true)
The radio animation while push-to-talk is held.

Config.RadioAnimationInVehicle boolean (default: false)
Off by default: the arm leaves the steering wheel.

Config.RadioAnimationDefault number (default: 1)
Which entry of RadioAnimations players get until they pick one.

Config.EmoteResource string (default: 'rpemotes')
Emote-based animations are only offered when this resource is running.

Config.RadioAnimations table
Each entry is a game animation (dict, anim, flag; flag 49 = loop, upper body only) or an rpemotes emote (emote). Defaults: Shoulder, Chest, Chest 2, Chest 3, Handheld, Handheld 2, Handheld 3, Right Shoulder.

Dispatcher

Config.UseCallsign boolean (default: true)
Dispatch addresses players by callsign.

Config.CallsignRepeatMs number (default: 8000)
Don't repeat the callsign on replies closer together than this.

Config.Confirm boolean (default: true)
Ask "affirmative / negative" before commands that need it (complete a callout, go off duty).

Config.AskWhenUnsure boolean (default: true)
When a transmission only roughly sounds like a command, ask "did you mean...?" instead of "say again".

Config.LearnCorrections boolean (default: true)
Remember each player's misheard words.

Config.ContextWindowMs number (default: 10000)
How long a confirm prompt, or "go ahead with the plate", waits for the next transmission.

Config.CalloutOfferWindowMs number (default: 30000)
How long after an offer "attach me" still accepts it.

Config.PlateCooldownMs number (default: 2800)
Minimum time between plate checks.

Config.VoiceVolume number (default: 70)
Dispatch's voice volume default, 0-100. Players override it in /control.

Config.Clicks table
The radio click sounds (on, off) and their volume (0-100, default 5).

Config.OnPanic function
Runs on "10-99" / "officer down", after dispatch's line. By default it fires the client event lwk_control:panic; hook your own panic system here.

Config.OnPanic = function()
    TriggerEvent('lwk_control:panic')
end

Traffic holds

Config.TrafficHold table

FieldDefaultWhat it does
radius50.0Metres
mph00 stops traffic; e.g. 15 slows it instead
minutes15Released automatically after this long
blipColour0Map circle colour (0 white, 1 red, 47 orange...)
blipAlpha90Map circle opacity, 0-255

Places

Config.Places table
Where "nearest hospital / police station / fire station / impound" routes to. Move them to match your MLOs, or add your own:

hospital = {
    { name = 'Pillbox Hill Medical Center', clip = 'pillbox', coords = vector3(298.6, -584.4, 43.3) },
},

clip is the spoken name, nui/voice/places/poi_<clip>.ogg in lwk_control_assets. An entry without a clip is announced generically ("route set to the nearest hospital").

Defaults: six hospitals, eight police and sheriff stations, six fire stations and the Mission Row impound.

Debug

Config.Debug boolean (default: false)
F8 shows what was heard, with a confidence for each word, and which command ran. Use it to work out why a phrase misses. The server console also prints each stopped vehicle's raw year, colour, make and model.