Kartik Scripts

Get Officer Info

Returns the MDT officer profile for an online player. This is useful for fetching the callsign, rank, or department of an active duty officer.

Export Syntax

exports['kartik-mdt']:GetOfficerInfo(source)

Parameters

ParameterTypeRequiredDescription
sourcenumberYesPlayer server ID

Return Value

  • Returns table containing officer info, or false if player source is invalid or has no job data:
{
    source     = number,   -- server ID
    citizenId  = string,   -- e.g. "QBX000123"
    name       = string,   -- "John Doe"
    callsign   = string,   -- e.g. "1-ADAM-12" or "UNIT" if unset
    rank       = string,   -- grade name e.g. "Sergeant"
    department = string,   -- job name e.g. "police"
    deptLabel  = string,   -- job label e.g. "LSPD"
    onDuty     = boolean,
}

Example Usage

local src = source
local officer = exports['kartik-mdt']:GetOfficerInfo(src)

if officer then
    print(string.format("Officer %s (%s) is on duty for %s", officer.name, officer.callsign, officer.deptLabel))
else
    print("Player is not an officer or is offline.")
end

On this page