> For the complete documentation index, see [llms.txt](https://mango-5m.gitbook.io/mango5m-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mango-5m.gitbook.io/mango5m-docs/resources/mango-mdt/features/warrants.md).

# Warrants

The warrant workflow — types, permission-based approval, printing and presenting in-game, and Discord export.

A full records-division warrant workflow: creation with config-driven types, a permission-based approval queue, execution tracking, an exported official document, and a **printable physical copy** officers present at the door. Config: `config/warrants.lua`.

## Warrant types

Four ship enabled — arrest, property search, vehicle search, evidence seizure. Each type controls whether the creation flow asks for vehicle details and/or a map location, and the legal directive sentence printed on the document. Adding a custom type is one new entry in `Config.Warrants.types`:

```lua
{
    key = 'bench',                -- stored on the warrant; never rename once used
    label = 'Bench Warrant',
    icon = 'gavel',
    needsVehicle = false,
    needsLocation = false,
    directive = 'Any peace officer is directed to take the named individual into custody for failure to appear.',
    expiryDays = 30,              -- default expiry pre-filled; nil = none
},
```

## Lifecycle

`draft` → `pending` → `active` → `executed` / `denied` / `expired` / `cancelled` — every transition recorded in a per-warrant audit history. Active warrants past their expiry flip to `expired` automatically (`autoExpire = true`).

## Approval — no judges, no hardcoded ranks

Approval is driven entirely by the permission system: anyone holding **`warrants.approve`** can approve or deny pending warrants.

```lua
approval = {
    required = true,                 -- false = submitting activates immediately
    autoApproveForApprovers = true,  -- approvers skip the queue for their own warrants
    autoApproveMinGrade = nil,       -- optional per-department grade gate, e.g. { police = 3 }
},
```

"Sergeants and above auto-approve" is expressed by granting `warrants.approve` to those ranks — in `config/ranks.lua` or live on the Permissions tab.

## Printing and presenting

**Print Warrant** hands the officer a `warrant` inventory item carrying that warrant's identity ([item setup](/mango5m-docs/resources/mango-mdt/configuration/inventory-items.md)). **Using the item presents the warrant full-screen** — to the holder *and everyone within 8 metres* (`nearbyRadius`), officer or civilian. Presenting a warrant is a public act; bystanders need no MDT access to see it.

* Auto-dismisses after `displaySeconds = 30` (Backspace closes immediately).
* The item is **never consumed** — one printed copy can be shown at every door on the block.

## Active-warrant banner

Any person with an active warrant gets a prominent **⚠ ACTIVE WARRANT** banner on their Person Database profile, with click-through to the warrant.

## Document export

Warrants export as a composited official document — department branding, charges, approval block, signatures — uploaded via [Fivemanage](/mango5m-docs/resources/mango-mdt/configuration/core-settings.md) and posted to the warrants Discord webhook:

{% code title="config/warrants.lua" %}

```lua
Config.DiscordWebhooks = Config.DiscordWebhooks or {}
Config.DiscordWebhooks.warrants = 'https://discord.com/api/webhooks/YOUR_WEBHOOK_HERE'
```

{% endcode %}

Leave blank to disable. `documentSubtitle` sets the letterhead line under the department name.

## Permissions

`warrants.create` / `view` / `view_all` / `approve` / `edit` / `delete` — all editable live on the Permissions tab.
