When to use: Client scripts on the same machine as the player.
When not to: Server integrations — use server exports.
IsMenuOpen
Section titled “IsMenuOpen”Parameters
none.
Returns
sync boolean — is the MDT tablet open?
Example
if exports['night_shifts_mdt']:IsMenuOpen() then print('tablet is open')endOpenMenu
Section titled “OpenMenu”Parameters
none.
Returns
none.
Example
exports['night_shifts_mdt']:OpenMenu()CloseMenu
Section titled “CloseMenu”Parameters
none.
Returns
none.
Example
exports['night_shifts_mdt']:CloseMenu()ToggleMenu
Section titled “ToggleMenu”Parameters
none.
Returns
none.
Example
exports['night_shifts_mdt']:ToggleMenu()ForwardCallToMDT (client)
Section titled “ForwardCallToMDT (client)”Client helper; still creates the call server-side. Same callData fields as the server export.
Parameters
| Name | Type | Required | Notes |
|---|---|---|---|
| callData | table | yes | Same shape as server ForwardCallToMDT |
Returns
none on the client (the server creates the call).
Example
exports['night_shifts_mdt']:ForwardCallToMDT({ callType = 'Traffic Collision', description = 'Two-vehicle RTC', x = 215.4, y = -810.2, z = 30.7, requiresPolice = 1, requiresAmbulance = 1,})IsOnPoliceShift
Section titled “IsOnPoliceShift”Parameters
none.
Returns
sync boolean for the local player.
Example
if exports['night_shifts_mdt']:IsOnPoliceShift() then exports['night_shifts_mdt']:OpenMenu()endIsOnAmbulanceShift
Section titled “IsOnAmbulanceShift”Example
if exports['night_shifts_mdt']:IsOnAmbulanceShift() then print('on ambulance shift')endIsOnFireShift
Section titled “IsOnFireShift”Example
if exports['night_shifts_mdt']:IsOnFireShift() then print('on fire shift')endIsOnTowShift
Section titled “IsOnTowShift”Example
if exports['night_shifts_mdt']:IsOnTowShift() then print('on tow shift')endIsOnCouncilShift
Section titled “IsOnCouncilShift”Example
if exports['night_shifts_mdt']:IsOnCouncilShift() then print('on council shift')endGetPlayerCallsign
Section titled “GetPlayerCallsign”Parameters
none.
Returns
sync string or nil.
Example
local callsign = exports['night_shifts_mdt']:GetPlayerCallsign()print(callsign)GetCurrentLanguage (client)
Section titled “GetCurrentLanguage (client)”Same return as the server read.
Example
print(exports['night_shifts_mdt']:GetCurrentLanguage())GetAvailableLanguages (client)
Section titled “GetAvailableLanguages (client)”Example
local languages = exports['night_shifts_mdt']:GetAvailableLanguages()print(languages[1])GetDepartments (client)
Section titled “GetDepartments (client)”Example
local depts = exports['night_shifts_mdt']:GetDepartments()print(#depts)