~/vipex/docs_
MDTExports

Client

Client-side export API reference for vx_mdt.

Client exports are intended for player-side integrations — item scripts, keybinds, or other client-only flows that need to interact with the local MDT.

They are not gated by the exportAllowlist (that setting only applies to server exports). Open requests are routed to the server internally, where setupOfficer enforces job, duty, and roster-status checks — so a client calling openTerminal() cannot bypass the same authorization the /mdt command runs.

For server-side exports see Server.

Terminal

openTerminal()

Open the MDT for the local player. Fires a server event that runs the full authorization flow (same as /mdt). Useful for item scripts where the player uses an item to open their tablet.

exports.vx_mdt:openTerminal()

closeTerminal()

Close the MDT for the local player. Pure client-side, no server round-trip. Safe to call when the MDT is already closed.

exports.vx_mdt:closeTerminal()

isTerminalOpen()

Check whether the local player has the MDT open. Reads the local terminal_subscribed state bag.

---@return boolean
local open = exports.vx_mdt:isTerminalOpen()

Dispatch

triggerPanic()

Send a panic signal as the local player. Mirrors the F9 keybind / dispatch overlay button — captures current coords and street name, then creates a priority-0 panic call broadcast to all departments.

Useful for custom keybind scripts, smartwatch items, or down-detection scripts that need to trigger panic without going through the MDT UI.

All existing guards still apply: the player must be on duty (have mdt_dep_id set), the server enforces jobCheck, source-based rate limiting, and per-identifier cooldown (dispatch.panicCooldown, default 30s).

---@return { id?: number, error?: string }
local result = exports.vx_mdt:triggerPanic()
if result and result.id then
    print("Panic call created with ID:", result.id)
end

Returns { id } on success, { error } on rejection (off duty, server cooldown, or job check failed). If the local cooldown is active, a toast is shown to the player and no server request is sent.


registerAutoDetectSuppressor(eventKey, fn)

Register a callback that can drop a specific auto-detection event before it generates a dispatch call. Useful for paintball minigames, arena events, scripted cutscenes, or any context where the player's actions shouldn't page LEOs.

eventKey must be one of gunshot, fight, carjacking, vehicleTheft, explosion, speeding. fn receives an event-specific context table and should return true to suppress, false/nil to allow.

Suppressors stack — multiple resources can each register their own. If any returns true, the event is dropped. Calls run before the cooldown timer, so suppressed events don't burn the cooldown window. See Suppression Hooks for the full ctx shape per event.

---@param eventKey "gunshot"|"fight"|"carjacking"|"vehicleTheft"|"explosion"|"speeding"
---@param fn fun(ctx: table): boolean?
---@return boolean ok
local ok = exports.vx_mdt:registerAutoDetectSuppressor("gunshot", function(ctx)
    return exports["pug-paintball"]:IsInPaintball()
end)

Returns true on success, false if the event key is unknown or arguments are invalid. Registrations are cleared on vx_mdt restart — re-register from your resource's start hook.

On this page