~/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.

On this page