Getting Started
DispatchAI provides a comprehensive set of export functions to trigger dispatch calls from your scripts. All exports follow a consistent pattern and can be called from any resource.
Base Export Format:
exports.dispatchai:ExportName(parameters)
Most exports accept a specificData table containing optional information about the event. This data helps create more detailed dispatch calls.
Custom Blips: Events can be given custom blips in the config. Simply append to the list of blips with your blip's title.
ps-dispatch Compatibility: The script can be masked as ps-dispatch if you have drug scripts that don't yet support DispatchAI. This allows for compatibility with existing scripts that use ps-dispatch exports.
Custom Event
exports.dispatchai:dsCustomEvent(eventData)
The most flexible export function. Allows you to create completely custom dispatch events with full control over event type, message, priority, and job restrictions.
Parameters
| Parameter |
Type |
Required |
Description |
| eventData |
table |
Yes |
Complete event data structure (see below) |
Event Data Structure
| Field |
Type |
Required |
Description |
| eventType |
string |
Yes |
The type of event (e.g., "Bank Robbery", "Traffic Stop", "Suspicious Activity") |
| message |
string |
Yes |
Message that the AI will receive and turn into dispatch call |
| specificData |
table |
No Optional |
Additional data about the event (see specificData fields below) |
| code |
number |
No |
Priority code: 1 (Low), 2 (Medium), 3 (High). Default: 3 |
| job |
table |
No |
Array of job names that should see this call (e.g., {"police"}, {"ems", "leo"}) |
Specific Data Fields (All Optional)
These fields can be included in the specificData table:
Plate - Vehicle license plate
Vehicle - Vehicle model name
Color - Vehicle color
Weapon - Weapon type
name - Person's name
gender - Person's gender
location - Location description
heading - Direction/heading
class - Vehicle class
Example
local eventData = {
eventType = "Bank Robbery",
message = "Armed robbery in progress",
specificData = {
Plate = "ABC123",
Vehicle = "Adder",
Color = "Red",
Weapon = "Pistol",
name = "John Doe"
},
code = 3,
job = {"police"}
}
exports.dispatchai:dsCustomEvent(eventData)
Shooting Call
exports.dispatchai:dsShootingCall(specificData)
Triggers a "shots fired" dispatch call. Automatically set to high priority (code 3).
Parameters
| Parameter |
Type |
Required |
Description |
| specificData |
table |
No Optional |
Additional information about the shooting incident |
Example
exports.dispatchai:dsShootingCall({
location = "Legion Square",
Weapon = "Pistol",
name = "Unknown Suspect"
})
Shooting From Vehicle
exports.dispatchai:dsShootingFromVehicleCall(specificData)
Triggers a "shooting from vehicle" dispatch call. Automatically set to high priority (code 3).
Parameters
| Parameter |
Type |
Required |
Description |
| specificData |
table |
No Optional |
Vehicle and suspect information |
Example
exports.dispatchai:dsShootingFromVehicleCall({
Plate = "XYZ789",
Vehicle = "Kuruma",
Color = "Black",
Weapon = "Assault Rifle"
})
Assault
exports.dispatchai:dsAssaultCall(specificData)
Triggers an "assault" dispatch call. Automatically set to high priority (code 3).
Parameters
| Parameter |
Type |
Required |
Description |
| specificData |
table |
No Optional |
Information about the assault incident |
Example
exports.dispatchai:dsAssaultCall({
location = "Downtown",
name = "John Smith",
gender = "male"
})
Vehicle Theft
exports.dispatchai:dsVehicleTheftCall(specificData)
Triggers a "vehicle theft" dispatch call. Automatically set to high priority (code 3).
Parameters
| Parameter |
Type |
Required |
Description |
| specificData |
table |
No Optional |
Stolen vehicle information |
Example
exports.dispatchai:dsVehicleTheftCall({
Plate = "STOLEN1",
Vehicle = "Adder",
Color = "Red",
heading = 180
})
Officer Down
exports.dispatchai:dsOfficerDownCall(specificData)
Triggers an "Officer Down" dispatch call with panic button audio. This is a local server event and does not require HTTP requests.
Note: This is a local server event. No HTTP requests are needed for this call.
Parameters
| Parameter |
Type |
Required |
Description |
| specificData |
table |
No Optional |
Information about the officer and location |
Example
exports.dispatchai:dsOfficerDownCall({
location = "Mission Row PD",
name = "Officer Johnson",
badge = "1234"
})
EMS Down
exports.dispatchai:dsEMSDownCall(specificData)
Triggers an "EMS Down" dispatch call with panic button audio. This call is automatically visible to both EMS and LEO (Law Enforcement Officers). This is a local server event and does not require HTTP requests.
Important: This call is automatically configured to show to both EMS and LEO jobs. This is a local server event.
Parameters
| Parameter |
Type |
Required |
Description |
| specificData |
table |
No Optional |
Information about the EMS personnel and location |
Example
exports.dispatchai:dsEMSDownCall({
location = "Pillbox Medical Center",
name = "Paramedic Smith"
})
Civilian Down
exports.dispatchai:dsCivilianDownCall(specificData)
Triggers a "civilian down" dispatch call. This is typically an EMS event. Automatically set to high priority (code 3).
Parameters
| Parameter |
Type |
Required |
Description |
| specificData |
table |
No Optional |
Information about the civilian and location |
Example
exports.dispatchai:dsCivilianDownCall({
location = "Vinewood Boulevard",
name = "Unknown",
gender = "male"
})
Fire Call
exports.dispatchai:dsFireCall(specificData)
Triggers a "fire smoke" dispatch call. Automatically set to high priority (code 3). This is useful if you have a fire department in your server.
Note: This doesn't have an in-game trigger event by default. You'll need to implement your own trigger for fire events.
Parameters
| Parameter |
Type |
Required |
Description |
| specificData |
table |
No Optional |
Information about the fire location and severity |
Example
exports.dispatchai:dsFireCall({
location = "Downtown Building",
severity = "Large fire"
})
Robbery
exports.dispatchai:dsRobberyCall(specificData)
Triggers a "robbery" dispatch call. Automatically set to high priority (code 3).
Note: This doesn't have an in-game trigger event by default. You'll need to implement your own trigger for robbery events. See documentation for more information.
Parameters
| Parameter |
Type |
Required |
Description |
| specificData |
table |
No Optional |
Information about the robbery location and suspect |
Example
exports.dispatchai:dsRobberyCall({
location = "24/7 Store",
name = "Unknown Suspect",
Weapon = "Pistol"
})
Bank Robbery
exports.dispatchai:dsBankRobberyCall(specificData)
Triggers a "bank robbery" dispatch call. Automatically set to high priority (code 3).
Note: This doesn't have an in-game trigger event by default. You'll need to implement your own trigger for bank robbery events. See documentation for more information.
Parameters
| Parameter |
Type |
Required |
Description |
| specificData |
table |
No Optional |
Information about the bank robbery location and suspects |
Example
exports.dispatchai:dsBankRobberyCall({
location = "Fleeca Bank",
name = "Multiple Suspects",
Weapon = "Assault Rifle"
})
Explosion
exports.dispatchai:dsExplosionCall(specificData)
Triggers an "explosion" dispatch call. Automatically set to high priority (code 3). This export has an in-game trigger event.
Parameters
| Parameter |
Type |
Required |
Description |
| specificData |
table |
No Optional |
Information about the explosion location |
Example
exports.dispatchai:dsExplosionCall({
location = "Downtown"
})
Drug Activity
exports.dispatchai:dsDrugCall(specificData)
Triggers a "drug activity" dispatch call. Automatically set to high priority (code 3).
Warning: This doesn't have an in-game trigger event by default. You'll need to implement your own trigger for drug activity events. This one can be difficult to implement - just a warning.
Parameters
| Parameter |
Type |
Required |
Description |
| specificData |
table |
No Optional |
Information about the drug activity location and suspects |
Example
exports.dispatchai:dsDrugCall({
location = "Alleyway",
name = "Unknown"
})