> For the complete documentation index, see [llms.txt](https://tefox-scripts.gitbook.io/tefox-scripts-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tefox-scripts.gitbook.io/tefox-scripts-docs/tefox-scripts-documentation/tefox_adminjail/configuration/jail-tasks.md). Agents can also search and read this documentation through its [MCP server](https://tefox-scripts.gitbook.io/tefox-scripts-docs/~gitbook/mcp).

# Jail Tasks

#### 🧹 How it works:

Prisoners can complete tasks around the prison to remove time from their sentence. Every task spot is marked in the prison and on the map. Tasks shorten the sentence, but never cancel the punishment.

***

#### ⚙️ General Settings:

```lua
Config.Tasks = {
    Enabled = true,
    Interaction = 'auto',   -- auto / key / ox_target / qb-target / qtarget / interact
    InteractDistance = 1.5,
    ShowMarkers = true,
    MarkerDistance = 30.0,
    MarkerColor = { r = 255, g = 122, b = 26 },
    Blips = { Enabled = true, Sprite = 1, Color = 17, Scale = 0.6 },
    MaxReduction = 50,      -- Max % of the sentence removable with tasks (0 = no limit)
    MinRemaining = 30,      -- No tasks in the last X seconds of a sentence
    LocationCooldown = 90   -- Seconds before the same spot can be used again
}
```

***

#### 📍 Adding Task Locations:

1. Stand where the player should stand and type `/jailcoords`.
2. The coordinates are copied to your clipboard.
3. Paste them in `Config.Tasks.Locations`:

```lua
Locations = {
    { type = 'sweep', coords = vector3(1752.56, 2544.06, 45.56) },
    { type = 'clean', coords = vector3(1712.26, 2566.20, 45.56) },
    { type = 'electric', coords = vector3(1761.52, 2540.48, 45.56), effect = vector3(1761.49, 2540.72, 45.86) }
}
```

{% hint style="info" %}
For electrical tasks, aim your camera at the fuse box before using `/jailcoords`. The `effect` value is where the sparks and the target appear.
{% endhint %}

{% hint style="success" %}
Use about **twice as many locations** as the number of players you expect in jail at the same time. Two players can't work on the same spot.
{% endhint %}

***

#### 🛠️ Creating a Task Type:

Copy one of the types in `Config.Tasks.Types` and give it a new name:

```lua
cook = {
    label = 'Cook in the kitchen',
    icon = 'fas fa-utensils',
    reduction = 12,      -- Seconds removed
    duration = 7000,     -- Progress bar duration (ms)
    cooldown = 120,      -- Optional, overrides LocationCooldown
    scenario = 'PROP_HUMAN_BBQ'
}
```

| Option               | Description                                            |
| -------------------- | ------------------------------------------------------ |
| `label`              | Name shown to players                                  |
| `icon`               | Font Awesome icon for target systems                   |
| `reduction`          | Seconds removed from the sentence                      |
| `duration`           | Task duration in milliseconds                          |
| `cooldown`           | Optional cooldown for this type only                   |
| `scenario` or `anim` | Animation played during the task                       |
| `prop`               | Optional object held in the hand                       |
| `minigame`           | Optional skill check: `hits`, `speed`, `zone`, `fails` |
| `litter`             | Optional trash that disappears while sweeping          |
| `sparks`             | Optional sparks shown until the task is done           |

{% hint style="info" %}
To translate a new task name, add `tasktype_cook = "..."` in your locale file.
{% endhint %}

***
