LG Dispatch
Exports & Integration
LG Dispatch exposes a small set of exports so other resources can talk to the dispatch system.
You can use these to:
Create dispatch calls from robbery, alarm, or shooting scripts
Trigger officer panic alerts
Read active calls from another resource
Resource folder name matters
The resource folder must be named exactly LG_Dispatch.
If you rename it (e.g. lg-dispatch or lg_dispatch), every example on this page will fail unless you also change the export name to match your folder.
Server vs client
Calling a server export from a client script will not work.
CreateDispatchCall
Server only
GetActiveCalls
Server only
TriggerPanic
Client only
CreateDispatchCall
Side: Server only
Creates a new call and broadcasts it to all on-duty emergency units.
Example
Returns
number
The new call ID
nil
Call was blocked by deduplication (same type, within radius + time window)
Fields
type (string, optional)
Call type key from Config.CallTypes.
Defaults to 'general' if missing or unknown.
Built-in types: 999, panic, robbery, shooting, traffic, medical, fire_call, general
priority (number, optional)
Grade / priority level (1–4).
If omitted, uses the call type’s defaultPriority.
coords (table, optional)
Incident world coordinates.
Must use named keys x, y, z:
vector3 also works:
Do not pass array-style coords like { 215.3, -810.5, 30.7 } — map markers and dedupe will break.
street (string, optional)
Location / street name.
Defaults to 'Unknown Location'.
description (string, optional)
Main incident description.
Defaults to the call type label.
callerNotes (string, optional)
Extra notes from the caller / system.
suspectInfo (string, optional)
Suspect description.
vehicleInfo (string, optional)
Vehicle / plate info.
postal (string, optional)
Postal code (if your server uses postals).
createdBy (string, optional)
Who/what created the call.
Defaults to 'System'.
Creating a call from a client script
Most robbery / alarm scripts run logic on the client.
CreateDispatchCall is server-only, so bridge it through your own server event.
Client
Server
Make sure LG_Dispatch is started before your integrating resource in server.cfg.
GetActiveCalls
Side: Server only
Returns all currently active (non-closed) dispatch calls.
Example
Returns
table — array of call objects.
Useful fields on each call:
id
number
Call ID
type
string
Call type key
typeLabel
string
Display label
priority
number
Grade 1–4
status
string
'active' / 'closed'
location
table
{ x, y, z } (not named coords)
street
string
Location name
postal
string
Postal
description
string
Description
callerNotes
string
Notes
suspectInfo
string
Suspects
vehicleInfo
string
Vehicle info
createdBy
string
Creator
createdAt
number
Unix timestamp
attachedUnits
table
Units attached to the call
TriggerPanic
Side: Client only
Triggers a Grade 1 officer assistance (panic) call at the local player’s current location.
Example
Requirements
The player must be an eligible emergency job
The player must be registered / on duty in LG Dispatch
If those are not met, the export returns silently and no call is created.
What happens
A Grade 1
paniccall is createdThe officer’s current coords + street are used
The call is broadcast to eligible units
The panic sound plays if
Config.Sounds.panic = true
Built-in command / keybind:
Command:
/panicDefault key:
F9
Deduplication
LG Dispatch ignores similar calls to stop spam.
Defaults:
A new call is skipped (export returns nil) when:
an active call already exists with the same type
within
DedupeRadiuscreated within the last
DedupeTimeseconds
This is intentional. If your script “sometimes doesn’t create a call”, check dedupe first.
Common mistakes
Export does nothing / errors on client
Calling server export from client
Create a server event and call the export there
No such export / nil export
Resource renamed
Keep folder name as LG_Dispatch or update export name
Call returns nil
Deduplication
Wait, move further away, or adjust DedupeRadius / DedupeTime
Panic does nothing
Player not on duty / not registered
Ensure unit is registered in dispatch first
Marker at 0,0,0
Missing/invalid coords
Pass { x = ..., y = ..., z = ... }
Wrong call label
Unknown type
Use a key from Config.CallTypes, or add your own
Default Configuration
Below is the default-style configuration included with LG Dispatch.
Edit config.lua only. Do not edit escrowed files.
Last updated