Server Exports
zephyr_mdt exposes three server-side exports for use by other resources.
GetBolos
Returns all active BOLOs from the database. Used by police and dispatch resources to display current BOLOs without going through the MDT UI.
local bolos = exports.zephyr_mdt:GetBolos()Returns: table — Array of BOLO objects. Returns {} on failure.
| Field | Type | Description |
|---|---|---|
id | string | BOLO ID (e.g. BOLO-0001). |
priority | number | Priority level (1 = high, 2 = medium, 3 = low). |
status | string | Always 'Active' from this export. |
subjectType | string | 'Person' or 'Vehicle'. |
subjectId | string | CID for persons, plate for vehicles. |
description | string | BOLO description text. |
lastSeen | string | Last known location or description. |
officer | string | Display name of the officer who created it. |
date | string | Creation date (YYYY-MM-DD). |
Example
local bolos = exports.zephyr_mdt:GetBolos()
for _, bolo in ipairs(bolos) do
print(bolo.id, bolo.subjectType, bolo.subjectId)
endUpsertDispatchBolo
Creates or updates a BOLO originating from an external dispatch system (e.g. zephyr_dispatch). If payload.mdtId matches an existing record it will be updated; otherwise a new BOLO is inserted.
local bolo = exports.zephyr_mdt:UpsertDispatchBolo(payload)Parameters
| Field | Type | Required | Description |
|---|---|---|---|
mdtId | string | No | Existing MDT BOLO ID to update. Omit to create a new one. |
subjectType | string | No | 'Person' or 'Vehicle'. Defaults to 'Person'. |
subjectId | string | No | CID or plate. Plates are auto-normalised. |
description | string | No | BOLO description / notes. |
lastSeen | string | No | Last known location text. |
priority | number | No | 1–3. Defaults to 2. |
status | string | No | 'Active', 'Cancelled', or 'Resolved'. |
active | boolean | No | false sets status to 'Cancelled'. |
createdByName | string | No | Display name shown as officer. Defaults to 'Dispatch'. |
Returns: table — The upserted BOLO object, or nil if payload is not a table.
Example
local bolo = exports.zephyr_mdt:UpsertDispatchBolo({
subjectType = 'Vehicle',
subjectId = 'ZPH 1234',
description = 'Armed robbery suspect — white Sentinel',
lastSeen = 'Route 68, heading east',
priority = 1,
createdByName = 'Dispatch'
})
if bolo then
print('BOLO created:', bolo.id)
endGetPersonByCitizenId
Returns a fully formatted person record for the given citizenid. Includes charge history, registered vehicles, properties, license statuses, demerits, and notes.
local person = exports.zephyr_mdt:GetPersonByCitizenId(citizenid)Parameters
| Parameter | Type | Description |
|---|---|---|
citizenid | string | The player’s citizenid (CID). |
Returns: table — Person object, or nil if not found.
Person object fields
| Field | Type | Description |
|---|---|---|
cid | string | Citizenid. |
firstName | string | First name. |
lastName | string | Last name. |
nickname | string | Nickname / alias. |
dob | string | Date of birth. |
gender | string | 'Male' or 'Female'. |
phone | string | Phone number (resolved from lb-phone / zephyr_phone). |
wanted | boolean | Whether an active wanted entry exists. |
armed | boolean | Whether the wanted entry marks them as armed. |
bolo | boolean | Whether an active BOLO references this person. |
wantedReason | string | Reason text from the wanted entry. |
bounty | number | Bounty amount from the wanted entry. |
mugshot | string|nil | Mugshot URL stored in player metadata, or nil. |
vehicles | table | Array of registered vehicle objects (see below). |
properties | table | Array of property objects (see below). |
licenses | table | Map of license type → status (e.g. { driving = 'valid' }). |
demerits | number | Total demerit points. |
charges | table | Array of past charge records (see below). |
notes | table | Array of officer notes (see below). |
Vehicle object
| Field | Type | Description |
|---|---|---|
plate | string | Vehicle plate. |
model | string | Vehicle model name. |
color | string | Resolved color string. |
status | string | 'Active', 'Out', or 'Impounded'. |
insurance | string | Always 'Insured' (current implementation). |
Charge record
| Field | Type | Description |
|---|---|---|
date | string | Charge date (YYYY-MM-DD). |
offence | string | Offence name. |
fine | number | Fine amount issued. |
jail | number | Jail time in months. |
officer | string | Officer display name. |
Note object
| Field | Type | Description |
|---|---|---|
text | string | Note content. |
category | string | Note category (e.g. 'General', 'Criminal'). |
officer | string | Officer who added the note. |
date | string | Date added (YYYY-MM-DD). |
Example
local person = exports.zephyr_mdt:GetPersonByCitizenId('ABC12345')
if person then
print(person.firstName, person.lastName, 'wanted:', person.wanted)
end