Skip to content

Exports: Client

The client-side exports.

When to use: Client scripts on the same machine as the player.

When not to: Server integrations — use server exports.

Parameters

none.

Returns

sync boolean — is the MDT tablet open?

Example

if exports['night_shifts_mdt']:IsMenuOpen() then
print('tablet is open')
end

Parameters

none.

Returns

none.

Example

exports['night_shifts_mdt']:OpenMenu()

Parameters

none.

Returns

none.

Example

exports['night_shifts_mdt']:CloseMenu()

Parameters

none.

Returns

none.

Example

exports['night_shifts_mdt']:ToggleMenu()

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,
})

Parameters

none.

Returns

sync boolean for the local player.

Example

if exports['night_shifts_mdt']:IsOnPoliceShift() then
exports['night_shifts_mdt']:OpenMenu()
end

Example

if exports['night_shifts_mdt']:IsOnAmbulanceShift() then
print('on ambulance shift')
end

Example

if exports['night_shifts_mdt']:IsOnFireShift() then
print('on fire shift')
end

Example

if exports['night_shifts_mdt']:IsOnTowShift() then
print('on tow shift')
end

Example

if exports['night_shifts_mdt']:IsOnCouncilShift() then
print('on council shift')
end

Parameters

none.

Returns

sync string or nil.

Example

local callsign = exports['night_shifts_mdt']:GetPlayerCallsign()
print(callsign)

Same return as the server read.

Example

print(exports['night_shifts_mdt']:GetCurrentLanguage())

Example

local languages = exports['night_shifts_mdt']:GetAvailableLanguages()
print(languages[1])

Example

local depts = exports['night_shifts_mdt']:GetDepartments()
print(#depts)