Skip to main content

Exports

Public client and server exports available from wasabi_mdt.

danger

The resource folder must be named wasabi_mdt for these examples to work unchanged.

Client exports​

OpenMDT​

Opens the MDT with optional page and camera deep-linking.

exports.wasabi_mdt:OpenMDT(targetPage, cameraId)
ParameterTypeRequiredDescription
targetPagestringNoPage ID to open, such as dispatch or cameras.
cameraIdnumberNoCamera ID to open on the cameras page.

Examples:

-- Open the default dashboard.
exports.wasabi_mdt:OpenMDT()

-- Open dispatch.
exports.wasabi_mdt:OpenMDT('dispatch')

-- Open a specific CCTV camera.
exports.wasabi_mdt:OpenMDT('cameras', 12)

Opening remains subject to MDT department/staff authorization.

CloseMDT​

Closes the MDT and releases NUI focus.

exports.wasabi_mdt:CloseMDT()

IsMDTOpen​

Returns whether the MDT interface is currently open.

local isOpen = exports.wasabi_mdt:IsMDTOpen()

Returns: boolean

CreateDispatch​

Requests a dispatch from the local client. The server validates that the player can open the MDT before creating the call.

exports.wasabi_mdt:CreateDispatch(data)
FieldTypeRequiredDescription
typestringNoDispatch type. Defaults to disturbance.
titlestringNoCall title. Defaults to Dispatch.
descriptionstringNoAdditional call details.
locationstringNoReadable location.
coordsvector3, vector4, or tableNoCall coordinates. Supports { x, y, z } or array form.
prioritynumberNoCall priority. Defaults to 1.
local player = exports.wasabi_mdt:GetPlayerData()

exports.wasabi_mdt:CreateDispatch({
type = 'robbery',
title = 'Store Robbery',
description = 'Armed suspect reported inside the store.',
location = player.location,
coords = player.coords,
priority = 4,
})

This client export does not return the created record. Use the server export when the calling resource needs the returned dispatch object.

SendPremadeDispatch​

Creates a dispatch from Config.PremadeDispatches and applies optional overrides.

exports.wasabi_mdt:SendPremadeDispatch(premadeType, overrides)
ParameterTypeRequiredDescription
premadeTypestringYesKey from Config.PremadeDispatches.
overridestableNoValues that replace template defaults.

Supported override fields:

  • type
  • title
  • description
  • priority
  • location
  • coords
exports.wasabi_mdt:SendPremadeDispatch('store_robbery', {
location = '24/7 Supermarket, Strawberry',
coords = GetEntityCoords(PlayerPedId()),
priority = 5,
})

When coordinates are omitted, the export uses the local player's coordinates and location.

GetPlayerData​

Returns the local player's coordinates and readable location information.

local player = exports.wasabi_mdt:GetPlayerData()

Example return:

{
coords = { x = 428.78, y = -985.59, z = 30.71 },
street = 'Sinner Street',
area = 'Mission Row',
location = 'Sinner Street, Mission Row',
}

TriggerPanic​

Triggers the configured officer panic flow for the local player.

exports.wasabi_mdt:TriggerPanic()

The server validates MDT access and applies the built-in panic cooldown.

ToggleBodyCam​

Starts or stops the local BodyCam workflow depending on its current state.

exports.wasabi_mdt:ToggleBodyCam()

StartBodyCam​

Starts the local BodyCam workflow.

exports.wasabi_mdt:StartBodyCam()

StopBodyCam​

Stops the local BodyCam workflow and requests clip saving according to the configured Medal settings.

exports.wasabi_mdt:StopBodyCam()

IsBodyCamActive​

Returns the local BodyCam state.

local active = exports.wasabi_mdt:IsBodyCamActive()

Returns: boolean

Server exports​

CreateDispatch​

Creates a dispatch directly from a trusted server resource and returns the created record.

local dispatch = exports.wasabi_mdt:CreateDispatch(data)

Common fields:

FieldTypeRequiredDescription
typestringNoDispatch type. Defaults to disturbance.
titlestringNoCall title. Defaults to Dispatch.
descriptionstringNoCall details.
locationstringNoReadable location.
coordsvector3, vector4, or tableNoCall coordinates.
prioritynumberNoPriority. Defaults to 1.
codestringNoOptional dispatch/radio code.
senderNamestringNoDisplay name of the sender.
responderstableNoInitial responder list.
pinnedbooleanNoInitial pinned state.
radionumberNoAssigned call radio channel.
local dispatch = exports.wasabi_mdt:CreateDispatch({
type = 'robbery',
title = 'Bank Alarm',
description = 'Silent alarm triggered at Fleeca Bank.',
location = 'Fleeca Bank, Legion Square',
coords = vector3(149.9, -1040.5, 29.4),
priority = 5,
code = '10-90',
senderName = 'Alarm System',
})

if dispatch then
print(('Created %s'):format(dispatch.dispatch_number))
end

Returns: dispatch table, or false if the dispatch module is unavailable.

GetActiveDispatches​

Returns active dispatches sorted by priority and creation time.

local calls = exports.wasabi_mdt:GetActiveDispatches()

Returns: array of dispatch tables.

GetRecentIncidents​

Returns the current first page of incidents from the server-side incident list.

local incidents = exports.wasabi_mdt:GetRecentIncidents()

Returns: array of incident tables.

GetVehicleByPlate​

Looks up a vehicle by plate.

local vehicle = exports.wasabi_mdt:GetVehicleByPlate('ABC123')

Returns: vehicle table, or nil when no match exists.

GetActiveWarrants​

Returns active warrants.

local warrants = exports.wasabi_mdt:GetActiveWarrants()

Returns: array of warrant tables.

IsOfficer​

Checks whether a player source can open the MDT through department permission or staff override.

local allowed = exports.wasabi_mdt:IsOfficer(source)
ParameterTypeDescription
sourcenumberServer source to check.

Returns: boolean

HasPermission​

Checks one MDT permission for a player source.

local canCreate = exports.wasabi_mdt:HasPermission(source, 'mdt.incidents.create')
ParameterTypeDescription
sourcenumberServer source to check.
keystringPermission key from the department configuration.

Returns: boolean

GetOfficers​

Returns the current officer roster.

local officers = exports.wasabi_mdt:GetOfficers()

Returns: array of officer roster tables.

GetDepartmentOfficers​

Returns officers belonging to one department/job.

local officers = exports.wasabi_mdt:GetDepartmentOfficers('police')
ParameterTypeDescription
departmentstringDepartment/job key from Config.Departments.

Returns: array of officer roster tables.

RefreshOfficers​

Compatibility export for integrations that previously requested a roster refresh.

local accepted = exports.wasabi_mdt:RefreshOfficers()

The current roster is maintained from framework player/job listeners, so this export currently acknowledges the request and returns true.

These server exports link or unlink another MDT entity to an incident, warrant, or evidence record.

Supported entity type strings include:

  • citizen
  • vehicle
  • weapon
  • property
  • evidence
  • charge
  • warrant
  • bolo
  • incident
  • officer

LinkEntityToIncident​

local success = exports.wasabi_mdt:LinkEntityToIncident(entityType, entityId, incidentId)
exports.wasabi_mdt:LinkEntityToIncident('vehicle', 42, 1001)

Returns: boolean

LinkEntityToWarrant​

local success = exports.wasabi_mdt:LinkEntityToWarrant(entityType, entityId, warrantId)
exports.wasabi_mdt:LinkEntityToWarrant('charge', 7, 24)

Returns: boolean

LinkEntityToEvidence​

local success = exports.wasabi_mdt:LinkEntityToEvidence(entityType, entityId, evidenceId)
exports.wasabi_mdt:LinkEntityToEvidence('citizen', 'ABC12345', 91)

Returns: boolean

UnlinkEntityFromIncident​

local success = exports.wasabi_mdt:UnlinkEntityFromIncident(entityType, entityId, incidentId)

Returns: boolean

UnlinkEntityFromWarrant​

local success = exports.wasabi_mdt:UnlinkEntityFromWarrant(entityType, entityId, warrantId)

Returns: boolean

UnlinkEntityFromEvidence​

local success = exports.wasabi_mdt:UnlinkEntityFromEvidence(entityType, entityId, evidenceId)

Returns: boolean

note

Direct link exports do not run the officer-facing NUI callback permission flow, charge link/unlink integration hooks, or automatic incident recalculation. Call them only from trusted server resources, validate your own input, and apply any required charge-side effects in the calling resource.