Get Penal Codes
Returns penal code entries registered in the MDT database.
Export Syntax
exports['kartik-mdt']:GetPenalCodes(department, query)Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
department | string or nil | No | nil | Optional filter by department name (e.g. "police") |
query | string or nil | No | nil | Optional search query matching penal code titles or categories |
Return Value
- Returns
tablecontaining an array of matched penal codes:
{
{
id = number,
title = string,
category = string,
fine = number,
jail = number,
description = string,
strike_weight = number,
community_service = number,
probation = number,
parole = number,
department = string,
},
...
}Example Usage
-- Get all penal codes containing "theft" in LSPD
local codes = exports['kartik-mdt']:GetPenalCodes("police", "theft")
print(string.format("Found %d matching penal codes:", #codes))
for _, code in ipairs(codes) do
print(string.format("- [%s] %s | Fine: $%d | Jail: %d months", code.category, code.title, code.fine, code.jail))
end