For the complete documentation index, see llms.txt. This page is also available as Markdown.

Server exports

Server-side exports for gks-tablet.

Dispatch

Active dispatches appear in Police/EMS MDT and the dispatch side panel.

Dispatch Table Schema

Full schema used by AddDispatch:

Field
Type
Required
Description

title

string

Yes

Dispatch title

description

string

Yes

Description / message body

code

string

No

Radio code (e.g. 10-90)

priority

string

No

'high', 'medium', or 'low' (default: 'low')

location

string or table

No

Street label, or { label, coords }

coords

vector2/vector3/table

Yes*

{ x, y, z } β€” required for map blip

job

string

No

'police' or 'ambulance' (default: 'police')

time

number

No

Unix timestamp (default: os.time())

image

string

No

Optional image URL

sound

string | false

No

Sound name or false to disable

fields

table[]

No

Extra rows: { icon, label, value? }

blip

table

No

{ sprite?, color?, size?, shortRange?, label? }

isRadius

boolean

No

Show radius circle on map

radius

number

No

Radius in meters when isRadius is true


AddDispatch

Create a dispatch using the full schema.

Parameters

Parameter
Type
Required
Description

dispatch

table

Yes

Full dispatch table (see schema above)

Returns

Type
Description

number

Dispatch ID (0 on invalid input)

Example

UpdateDispatch

Update an active dispatch (partial updates supported).

Parameters

Parameter
Type
Required
Description

id

number

Yes

Dispatch ID

dispatch

table

Yes

Fields to update (title, description, priority, coords, responders, etc.)

Returns

Type
Description

boolean

true if found and updated


RemoveDispatch

Remove a dispatch by ID and notify MDT clients.

Returns

Type
Description

boolean

true if removed


GetDispatch

Get a single active dispatch.

Returns

Type
Description

table | nil

Dispatch table or nil


GetDispatches

List all active dispatches, optionally filtered by job.

Parameters

Parameter
Type
Required
Description

job

string

No

'police' or 'ambulance' β€” omit for all

Returns

Type
Description

table[]

Array of dispatch tables


UpdateResponderCallsign

Rename a responder callsign across all active dispatches (used when officers rename units or personal callsigns).

Returns

Nothing.

MDT Records

Create and manage Police MDT records from external resources. All write operations log to the MDT audit trail when source is a valid player.

RegisterWeapon

Register a weapon in the MDT weapons database.

Parameters

Parameter
Type
Required
Description

serialNumber

string

Yes

Weapon serial number

data

table

No

{ weaponName/model, owner, owner_id/ownerId, stolen? }

Returns

Type
Description

number | false

Weapon record ID or false

GetPoliceCallsign

Get an officer's personal callsign from MDT personnel records.

Returns

Type
Description

string | nil

Callsign


SetPoliceCallsign

Set or update an officer's callsign. Refreshes live map tracking and roster.

Parameters

Parameter
Type
Required
Description

identifier

string

Yes

Framework identifier / citizenid

callsign

string

Yes

New callsign

ignoreCallsignCheck

boolean

No

Skip validation (optional)

Returns

Type
Description

boolean

true on success

Units and Callsigns

In-memory unit management for Police and EMS MDT. Units affect dispatch responder names on the live map.

GetPlayerUnit

Get the unit name assigned to an online officer.

Returns

Type
Description

string | nil

Unit name


GetUnits

List all units for a job.

Parameters

Parameter
Type
Default
Description

job

string

'police'

'police' or 'ambulance'

Returns

Type
Description

table[]

{ name, status }


SetPlayerUnit

Assign an officer to a unit.

Returns

Type
Description

boolean

true on success


ResetPlayerUnit

Remove an officer from their current unit.


CreateUnit / RemoveUnit / SetUnitStatus / RenameUnit

CreateUnit default status is 'station'. RenameUnit updates dispatch responders for all officers in the unit.


GetPlayerUnitStatus

Get unit status by identifier (works offline).

Returns

Type
Description

string

Status or 'available'


GetOfficerCallsign

Get personal callsign for an online player from MDT personnel DB.

Returns

Type
Description

string | nil

Callsign


Notifications

Send notifications to the tablet lockscreen (not Dynamic Island β€” that is GKSPHONE).

Notification Data Schema

Field
Type
Default
Description

title

string

"Notification"

Title (required with message)

message

string

""

Body text

app

string

"System"

Source app name


SendNotification

Send to one player.

Returns

Type
Description

boolean

true if delivered


BroadcastNotification

Send to all online players.

Returns

Type
Description

number

Count of players notified


SendJobNotification

Send to all players with a specific job name.

Example


SendNotificationToPlayers

Send to a list of server IDs.


Tablet Management

Database operations for tablet records (gks_tablet table).

GetTabletByUniqID

Returns full tablet row with parsed settings JSON, or nil.


GetTabletByPlayerIdentifier

Lookup by framework identifier (citizenid / license).


Last updated