ESX Installation

ESX-specific setup for oxide-dispatch on an ESX Legacy server.

ESX-specific setup for oxide-dispatch on an ESX Legacy server.

Requirements

  • es_extended
  • ox_lib
  • oxmysql
  • o-link
  • oxide-dispatch
  • oxide-police (recommended for duty-aware police alert delivery)

Startup Order

Start dependencies before Oxide Dispatch:

ensure oxmysql
ensure ox_lib
ensure [core]
ensure o-link
ensure oxide-dispatch

If Oxide Police is installed, start Dispatch before Police:

ensure oxide-dispatch
ensure oxide-police

SQL

Run the Oxide Dispatch SQL before starting the resource:

resources/[oxide]/oxide-dispatch/sql/install.sql

This creates:

dispatch_alerts
dispatch_responders

ESX Jobs

Dispatch sends alerts to framework jobs listed in:

oxide-dispatch/shared/config/jobs.lua

Default police responder jobs:

police = {
    jobs = { 'police', 'lspd', 'bcso', 'sasp', 'sheriff', 'statetrooper',
             'LSPD', 'BCSO', 'SASP' },
    ...
}

Every job name used by an Oxide Police department must exist in the ESX jobs table. Dispatch resolves recipients through o-link and ESX jobs, then checks exports['oxide-police']:IsPlayerOnDuty(source) for police alerts when Oxide Police is running.

When installing with Oxide Police on ESX, enable Config.Compatibility['es_extended'].jobSync.enabled = true in oxide-police/shared/config/compat.lua. That sync keeps ESX jobs and job_grades aligned with departments and grades created in /padmin.

ESX Compatibility

Oxide Dispatch includes an ESX compatibility shim — a small built-in translator that catches the alert events ESX scripts already send and converts them into Oxide Dispatch alerts, so you don't have to edit those scripts:

oxide-dispatch/server/compat/es_extended.lua
oxide-dispatch/client/compat/es_extended.lua

The server shim listens for common ESX ecosystem alert events and converts them into Oxide Dispatch alerts:

TriggerEvent('esx_policejob:alert', messageOrData, coords, playerSource)
TriggerEvent('esx_policejob:policeAlert', messageOrData, coords, playerSource)
TriggerEvent('esx_outlawalert:policeNotify', data, playerSource)
TriggerEvent('esx_outlawalert:outlawNotify', data, playerSource)
TriggerEvent('esx_phone:send', 'police', message, anonymous, coords, playerSource)
TriggerEvent('esx_phone:send', 'ambulance', message, anonymous, coords, playerSource)
TriggerEvent('esx_ambulancejob:onPlayerDistress')

For server-side calls where source is 0, pass either explicit coordinates or the triggering player source. Alerts without coordinates and without a usable player source are rejected — they simply never appear for police.

Each path is independently toggleable in shared/config/compat.lua:

Config.Compatibility['es_extended'] = {
    enabled = true,
    serverPoliceAlert = true,    -- esx_policejob:alert / :policeAlert
    clientPoliceAlert = false,   -- client-side relay (see warning below)
    esxPhoneSend = true,         -- esx_phone:send (police contact); also the master switch for the esxPhoneEms ambulance path below
    outlawAlert = true,          -- esx_outlawalert events
    distressAlert = true,        -- esx_ambulancejob:onPlayerDistress
    esxPhoneEms = true,          -- esx_phone:send (ambulance contact) -- only active when esxPhoneSend is also true
    emsJobs = 'ems',             -- group/jobs the converted ambulance alert is addressed to
    emsCode = '10-52',
    jobs = 'police',
    defaultCode = '10-31',
    rateLimitMs = 5000,
}

Client-side relay caveat

clientPoliceAlert is disabled by default because some ESX outlaw-alert resources send their alert events to the police officers' own game clients rather than from the player who caused the alert. If the shim forwarded those, alerts would appear at the officers' own locations instead of the crime scene — officers would get pings pointing at themselves. Enable clientPoliceAlert only if the source script emits alerts from the reporting player's client.

When oxide-police is installed, disable conflicting ESX police resources to prevent double-handling alerts:

  • esx_policejob — replaced by oxide-police
  • Any custom MDT that listens to the same dispatch events

Testing Checklist

  • SQL has been run.
  • o-link starts before Oxide Dispatch.
  • Oxide Dispatch starts before Oxide Police.
  • Oxide Police ESX job sync is enabled, or ESX police jobs exist manually in the database.
  • oxide-dispatch/shared/config/jobs.lua contains the jobs used by the server.
  • esx_policejob is disabled if Oxide Police is installed.
  • At least one officer is hired and clocked in through Oxide Police.
  • /testdispatch 10-71 police creates an alert. Run it from the server console, or grant in-game admins the permission first with add_ace group.admin command.testdispatch allow in server.cfg — without it, the in-game command silently does nothing.
  • A legacy ESX alert event creates an Oxide Dispatch alert with coordinates.
  • /911 robbery in progress from a citizen reaches on-duty police.
  • /panic from a clocked-in officer reaches colleagues (including off-duty when Config.Panic.broadcastOffDuty = true).
  • Alerts are received only by configured, on-duty police jobs.

Next Steps