Kartik Scripts

Get Warrants

Returns active or historical warrant records from the MDT.

Export Syntax

exports['kartik-mdt']:GetWarrants(query, status)

Parameters

ParameterTypeRequiredDefaultDescription
querystringNo""Optional partial name or Citizen ID filter
statusstringNo"Active""Active" or "History"

Return Value

  • Returns table containing 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

On this page