> For the complete documentation index, see [llms.txt](https://izaap-studios.gitbook.io/izaap-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://izaap-studios.gitbook.io/izaap-scripts/punishments-v2/exports-list.md).

# Exports List

```md
# Exports List

## Punishment Exports

The punishment system provides **2 server-side exports** that can be used from other resources, admin systems, or Discord bot bridges.

> **Important**
>
> These exports are **server-side only**.
>
> They must be called from:
> - `server.lua`
> - server events
> - server commands
> - Discord bot bridge resources
> - other server-side integrations
>
> They **cannot** be used from `client.lua`.
```

***

### 1. `ApplyPunishment`

Generic export used to apply either a **PED punishment** or a **cleaning punishment**.

#### Syntax

```lua
exports['izaap_punishment']:ApplyPunishment(payload)
```

#### Parameters

| Field           | Type     | Required      | Description                                                                      |
| --------------- | -------- | ------------- | -------------------------------------------------------------------------------- |
| `type`          | `string` | Yes           | Punishment type: `"ped"` or `"clean"`                                            |
| `citizenid`     | `string` | Conditionally | Target player identifier. Recommended for both online and offline punishments    |
| `id`            | `number` | Conditionally | Player server ID (`source`) if the player is online                              |
| `player_name`   | `string` | No            | Player name. Recommended when punishing offline players                          |
| `reason`        | `string` | No            | Reason for the punishment                                                        |
| `time`          | `number` | Yes for PED   | PED punishment duration                                                          |
| `sweeps`        | `number` | Yes for CLEAN | Number of required cleaning sweeps                                               |
| `location`      | `string` | No            | Cleaning location. If not provided, the default configured location will be used |
| `staff_name`    | `string` | No            | Name of the staff member, admin system, or bot applying the punishment           |
| `staff_discord` | `string` | No            | Discord identifier or label of the actor applying the punishment                 |

#### PED Example

```lua
local result = exports['izaap_punishment']:ApplyPunishment({
    type = "ped",
    citizenid = "license:110000112345678",
    player_name = "Haze",
    reason = "PED punishment sent from Discord",
    time = 15,
    staff_name = "Discord Bot",
    staff_discord = "discord:123456789012345678"
})

print(json.encode(result))
```

#### CLEAN Example

```lua
local result = exports['izaap_punishment']:ApplyPunishment({
    type = "clean",
    citizenid = "license:110000112345678",
    player_name = "Haze",
    reason = "Cleaning punishment sent from Discord",
    sweeps = 20,
    location = "barco",
    staff_name = "Discord Bot",
    staff_discord = "discord:123456789012345678"
})

print(json.encode(result))
```

#### Online Player Example

```lua
local result = exports['izaap_punishment']:ApplyPunishment({
    type = "clean",
    id = 12,
    reason = "Cleaning punishment for misconduct",
    sweeps = 10,
    location = "barco",
    staff_name = "Discord Bot",
    staff_discord = "discord:123456789012345678"
})

print(json.encode(result))
```

***

### 2. `SendCleanPunishment`

Specific export used only to apply a **cleaning punishment**.

#### Syntax

```lua
exports['izaap_punishment']:SendCleanPunishment(payload)
```

#### Parameters

| Field           | Type     | Required      | Description                                                                      |
| --------------- | -------- | ------------- | -------------------------------------------------------------------------------- |
| `citizenid`     | `string` | Conditionally | Target player identifier. Recommended for both online and offline punishments    |
| `id`            | `number` | Conditionally | Player server ID (`source`) if the player is online                              |
| `player_name`   | `string` | No            | Player name. Recommended when punishing offline players                          |
| `reason`        | `string` | No            | Reason for the punishment                                                        |
| `sweeps`        | `number` | Yes           | Number of required cleaning sweeps                                               |
| `location`      | `string` | No            | Cleaning location. If not provided, the default configured location will be used |
| `staff_name`    | `string` | No            | Name of the staff member, admin system, or bot applying the punishment           |
| `staff_discord` | `string` | No            | Discord identifier or label of the actor applying the punishment                 |

#### Example

```lua
local result = exports['izaap_punishment']:SendCleanPunishment({
    citizenid = "license:110000112345678",
    player_name = "Haze",
    reason = "Cleaning punishment sent from Discord",
    sweeps = 25,
    location = "barco",
    staff_name = "Discord Bot",
    staff_discord = "discord:123456789012345678"
})

print(json.encode(result))
```

#### Online Player Example

```lua
local result = exports['izaap_punishment']:SendCleanPunishment({
    id = 12,
    reason = "Cleaning punishment applied from admin integration",
    sweeps = 10,
    location = "barco",
    staff_name = "Discord Bot",
    staff_discord = "discord:123456789012345678"
})

print(json.encode(result))
```

***

### Notes

* These exports support both **online** and **offline** punishments
* If both `id` and `citizenid` are provided, the system will resolve the target using the available player data
* `citizenid` is the recommended identifier for external integrations
* `player_name` is recommended for better logs when the player is offline
* `staff_name` and `staff_discord` are optional, but strongly recommended for Discord bot and admin integration logs

***

### Recommended Payload for External Integrations

For the best compatibility, external systems should send:

```lua
{
    citizenid = "license:xxxxxxxxxxxxxxxx",
    player_name = "Player Name",
    reason = "Punishment reason",
    staff_name = "Discord Bot",
    staff_discord = "discord:123456789012345678"
}
```

***

### Quick Reference

#### Generic export

```lua
exports['izaap_punishment']:ApplyPunishment({
    type = "ped" or "clean",
    citizenid = "license:xxxxxxxxx",
    id = 1,
    player_name = "Player Name",
    reason = "Reason",
    time = 10,
    sweeps = 15,
    location = "barco",
    staff_name = "Discord Bot",
    staff_discord = "discord:123456789"
})
```

#### Cleaning-only export

```lua
exports['izaap_punishment']:SendCleanPunishment({
    citizenid = "license:xxxxxxxxx",
    id = 1,
    player_name = "Player Name",
    reason = "Reason",
    sweeps = 15,
    location = "barco",
    staff_name = "Discord Bot",
    staff_discord = "discord:123456789"
})
```
