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
| Parameter | Type | Required | Description |
|---|---|---|---|
source | number | Yes | Player server ID |
Return Value
- Returns
tablecontaining officer info, orfalseif 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