Skip to main content

Events

Integration events exposed by wasabi_mdt.

tip

Prefer the documented exports when an equivalent export exists. Events listed as notifications should be listened to rather than triggered.

Client control events

wasabi_mdt:client:open

Opens the MDT. Optional arguments can deep-link to a page or CCTV camera.

TriggerEvent('wasabi_mdt:client:open', targetPage, cameraId)
ParameterTypeRequiredDescription
targetPagestringNoPage ID to open, such as dispatch or cameras.
cameraIdnumberNoCamera to open when deep-linking to the cameras page.

The OpenMDT client export is preferred for third-party integrations.

wasabi_mdt:client:close

Closes the MDT and releases NUI focus.

TriggerEvent('wasabi_mdt:client:close')

The CloseMDT client export is preferred for third-party integrations.

Client notification events

These events are emitted by the resource and are safe to listen to.

wasabi_mdt:onOpen

Fired after the MDT opens.

AddEventHandler('wasabi_mdt:onOpen', function()
-- Pause or hide your integration while the MDT is open.
end)

wasabi_mdt:onClose

Fired when the MDT is fully closed through its normal close flow.

AddEventHandler('wasabi_mdt:onClose', function()
-- Restore your integration.
end)

wasabi_mdt:bodycamActiveChanged

Fired when the local BodyCam state changes.

AddEventHandler('wasabi_mdt:bodycamActiveChanged', function(active)
print(('BodyCam active: %s'):format(tostring(active)))
end)
ParameterTypeDescription
activebooleantrue while the BodyCam workflow is active.

wasabi_mdt:client:newDispatch

Broadcast to configured department members and staff when a new dispatch is created.

AddEventHandler('wasabi_mdt:client:newDispatch', function(dispatch)
print(('New call: %s'):format(dispatch.title))
end)

Common dispatch fields include:

  • id
  • dispatch_number
  • type
  • title
  • description
  • location
  • coords
  • priority
  • code
  • sender
  • status
  • responders
  • pinned
  • radio
  • created_at

Listen to this event for display/integration work. Use the CreateDispatch export to create calls.

wasabi_mdt:client:dispatchUpdated

Broadcast to configured department members and staff when an active dispatch changes.

AddEventHandler('wasabi_mdt:client:dispatchUpdated', function(dispatch)
print(('Updated call: %s'):format(dispatch.dispatch_number))
end)
ParameterTypeDescription
dispatchtableComplete updated dispatch record.

wasabi_mdt:client:dispatchRemoved

Broadcast when an active dispatch is removed or expires.

AddEventHandler('wasabi_mdt:client:dispatchRemoved', function(id)
print(('Removed dispatch ID: %s'):format(id))
end)
ParameterTypeDescription
idnumberInternal ID of the removed dispatch.

Charge integration hooks

These hooks are fired when an officer links or unlinks a charge and an incident. They are intended for billing, jail, audit, or custom workflow integrations.

The server event is always fired. A matching client event is also sent to the incident's primary citizen when that citizen is online.

wasabi_mdt:onChargeLinked

AddEventHandler('wasabi_mdt:onChargeLinked', function(
chargeData,
primaryIdentifier,
incidentData,
officerData,
adjustments
)
local fine = adjustments and adjustments.adjusted_fine or chargeData.fine
local jailTime = adjustments and adjustments.adjusted_jail or chargeData.jail_time

-- Create your invoice or jail action here.
end)
ParameterTypeDescription
chargeDatatableCharge record including title, description, fine, jail time, and category.
primaryIdentifierstring or nilIdentifier of the incident's primary citizen.
incidentDatatableIncident summary and optional primary citizen data.
officerDatatableLinking officer identifier, name, and department/job.
adjustmentstable or nilAdjusted fine/jail and reduction metadata stored on the link.

A matching client listener uses the same parameters:

RegisterNetEvent('wasabi_mdt:onChargeLinked', function(chargeData, primaryIdentifier, incidentData, officerData, adjustments)
-- Runs for the online primary citizen.
end)

wasabi_mdt:onChargeUnlinked

AddEventHandler('wasabi_mdt:onChargeUnlinked', function(
chargeData,
primaryIdentifier,
incidentData,
officerData
)
-- Refund, reverse, or log the removed charge here.
end)
ParameterTypeDescription
chargeDatatableCharge that was removed from the incident.
primaryIdentifierstring or nilIdentifier of the incident's primary citizen.
incidentDatatableIncident summary and optional primary citizen data.
officerDatatableOfficer who removed the link.

Migration from older integrations

The old wasabi_mdt:createExternalDispatch event is not part of the current public API. Replace it with a CreateDispatch export:

-- Client-side
exports.wasabi_mdt:CreateDispatch(data)

-- Server-side
exports.wasabi_mdt:CreateDispatch(data)
warning

Other wasabi_mdt:server:*, framework bridge, patrol, camera synchronization, and NUI callback events are internal implementation details. Do not trigger them from third-party resources; their validation and payloads may change.