zephyr_mdtExportsServer

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.

FieldTypeDescription
idstringBOLO ID (e.g. BOLO-0001).
prioritynumberPriority level (1 = high, 2 = medium, 3 = low).
statusstringAlways 'Active' from this export.
subjectTypestring'Person' or 'Vehicle'.
subjectIdstringCID for persons, plate for vehicles.
descriptionstringBOLO description text.
lastSeenstringLast known location or description.
officerstringDisplay name of the officer who created it.
datestringCreation date (YYYY-MM-DD).

Example

local bolos = exports.zephyr_mdt:GetBolos()
for _, bolo in ipairs(bolos) do
    print(bolo.id, bolo.subjectType, bolo.subjectId)
end

UpsertDispatchBolo

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

FieldTypeRequiredDescription
mdtIdstringNoExisting MDT BOLO ID to update. Omit to create a new one.
subjectTypestringNo'Person' or 'Vehicle'. Defaults to 'Person'.
subjectIdstringNoCID or plate. Plates are auto-normalised.
descriptionstringNoBOLO description / notes.
lastSeenstringNoLast known location text.
prioritynumberNo1–3. Defaults to 2.
statusstringNo'Active', 'Cancelled', or 'Resolved'.
activebooleanNofalse sets status to 'Cancelled'.
createdByNamestringNoDisplay 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)
end

GetPersonByCitizenId

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

ParameterTypeDescription
citizenidstringThe player’s citizenid (CID).

Returns: table — Person object, or nil if not found.

Person object fields

FieldTypeDescription
cidstringCitizenid.
firstNamestringFirst name.
lastNamestringLast name.
nicknamestringNickname / alias.
dobstringDate of birth.
genderstring'Male' or 'Female'.
phonestringPhone number (resolved from lb-phone / zephyr_phone).
wantedbooleanWhether an active wanted entry exists.
armedbooleanWhether the wanted entry marks them as armed.
bolobooleanWhether an active BOLO references this person.
wantedReasonstringReason text from the wanted entry.
bountynumberBounty amount from the wanted entry.
mugshotstring|nilMugshot URL stored in player metadata, or nil.
vehiclestableArray of registered vehicle objects (see below).
propertiestableArray of property objects (see below).
licensestableMap of license type → status (e.g. { driving = 'valid' }).
demeritsnumberTotal demerit points.
chargestableArray of past charge records (see below).
notestableArray of officer notes (see below).

Vehicle object

FieldTypeDescription
platestringVehicle plate.
modelstringVehicle model name.
colorstringResolved color string.
statusstring'Active', 'Out', or 'Impounded'.
insurancestringAlways 'Insured' (current implementation).

Charge record

FieldTypeDescription
datestringCharge date (YYYY-MM-DD).
offencestringOffence name.
finenumberFine amount issued.
jailnumberJail time in months.
officerstringOfficer display name.

Note object

FieldTypeDescription
textstringNote content.
categorystringNote category (e.g. 'General', 'Criminal').
officerstringOfficer who added the note.
datestringDate added (YYYY-MM-DD).

Example

local person = exports.zephyr_mdt:GetPersonByCitizenId('ABC12345')
if person then
    print(person.firstName, person.lastName, 'wanted:', person.wanted)
end