Get Warrants
Returns active or historical warrant records from the MDT.
Export Syntax
exports['kartik-mdt']:GetWarrants(query, status)Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query | string | No | "" | Optional partial name or Citizen ID filter |
status | string | No | "Active" | "Active" or "History" |
Return Value
- Returns
tablecontaining an array of matched warrants:
{
{
id = number,
citizenId = string,
firstname = string,
surname = string,
reason = string,
authorName = string,
status = string, -- "active" | "revoked" | "expired"
isDangerous = boolean,
createdAt = string, -- MySQL DATETIME
resolvedAt = string|nil,
resolvedByName = string|nil,
},
...
}Example Usage
-- Fetch all active warrants
local warrants = exports['kartik-mdt']:GetWarrants("", "Active")
print(string.format("Found %d active warrants:", #warrants))
for _, w in ipairs(warrants) do
local dangerTag = w.isDangerous and "[EXTREME RISK] " or ""
print(string.format("- %s%s %s (%s) - Reason: %s", dangerTag, w.firstname, w.surname, w.citizenId, w.reason))
end