# Warrants

Here, you'll find key exports for managing warrants. These exports allow you to create, update, and delete warrants as needed.

***

## Type

```typescript
type Warrant = {
    id: number,
    reason: string,
    house: string | number, // depends on your housing script
    date: number,
    active: boolean,
    createdAt: string,
    tag?: {
        identifier: string,
        label: string,
        color: string
    },
    players: {
        identifier: string,
        name: string
    }[]
}
```

## Exports

### SearchWarrant

```lua
exports['redutzu-mdt']:SearchWarrant(id: number) // WarrantType | null
```

### CreateWarrant

```lua
exports['redutzu-mdt']:CreateWarrant({
  reason = 'Warrant reason',
  players = { 'license:1234', 'license:4321' }, -- array of identifiers/citizenids
  house = 1, -- depends on your housing script (usually the id)
  tag = 'tag identifier',
  date = 1716935068 -- javascript timestamp (this is the starting date)
}) -- number (id)
```

### UpdateWarrant

```lua
-- It returns a boolean (if it was successfully updated)
exports['redutzu-mdt']:UpdateWarrant(id, {
  reason = 'New reason',
  players = { 'license:0000' }
}) -- boolean
```

```lua
local success = exports['redutzu-mdt']:UpdateWarrant(1, {
    reason = 'New reason',
    players = { 'license:0000' }
})

if not success then
    print('There was an error updating the warrant')
    return
end

print('Warrant updated')
```

### DeleteWarrant

```lua
-- It returns a boolean (if it was successfully deleted)
exports['redutzu-mdt']:DeleteWarrant(id: number) // boolean
```

```lua
local success = exports['redutzu-mdt']:DeleteWarrant(1)

if not success then
    print('There was an error deleting the warrant')
    return
end

print('Warrant deleted')
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.redutzu.com/resources/redutzu-mdt/exports-events/server-exports/warrants.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
