> For the complete documentation index, see [llms.txt](https://docs.cuxial.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cuxial.com/scripts/core/cuxial-cmservices/configuration.md).

# Configuration

Every option of Cuxial Community Service: the work zone, the tasks and the jail cells.

Everything you can adjust lives in `config/shared.lua`: the community service zone and its tasks under `COMSERV`, and the jail under `JAIL`. Restart the resource after any change.

{% hint style="info" %}
The coordinates, task names and labels delivered in the file are an example location. Replace them with the places of your own map.
{% endhint %}

## Community service · `COMSERV`

| Option             | Type    | Default | What it does                                                                                                                                                 |
| ------------------ | ------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `coords`           | vector3 | example | Where the player is placed when the sanction starts, and where they are brought back to when they leave the zone. Its height is also the height of the zone. |
| `outCoords.Coords` | vector3 | example | Exit point. The player is moved here when the tasks are finished or when staff remove the sanction.                                                          |

### Zone · `COMSERV.polyZone`

The polygon the player cannot leave. Inside it attacks are disabled and stamina does not run out.

| Option      | Type       | Default | What it does                                                                                         |
| ----------- | ---------- | ------- | ---------------------------------------------------------------------------------------------------- |
| `points`    | vector3\[] | example | Corners of the polygon, in order. Only `x` and `y` are used; the height comes from `COMSERV.coords`. |
| `thickness` | number     | `50`    | Height of the zone in metres, centred on the height of `COMSERV.coords`.                             |
| `debug`     | boolean    | `true`  | `true` draws the walls of the zone in the world. `false` hides them. Use `false` on a live server.   |

{% hint style="warning" %}
`COMSERV.coords` and every task must be inside the polygon. A task placed outside cannot be reached: the player is brought back as soon as they cross the edge.
{% endhint %}

### Tasks · `COMSERV.taskZones`

Tasks are grouped in five categories. Each category is a list; an empty list is skipped. At least one category needs a task.

| Category       | Blip and route colour | Meant for                       |
| -------------- | --------------------- | ------------------------------- |
| `construction` | Yellow                | Building and welding work       |
| `gardening`    | Green                 | Plants and green areas          |
| `cleaning`     | Blue                  | Trash and cleaning              |
| `maintenance`  | Orange                | Upkeep of the facilities        |
| `repairs`      | Red                   | Broken equipment and structures |

The script picks a category at random among the ones that have tasks, then a task inside it, and avoids repeating the previous spot.

Each task is a table with these fields:

| Field               | Type             | Default                    | What it does                                                                                                                                                                |
| ------------------- | ---------------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `coords`            | vector3          | required                   | Interaction point and blip position. The player must be within 3 metres to start.                                                                                           |
| `name`              | string           | generic name               | Name of the task on the blip and in the start notification.                                                                                                                 |
| `object.model`      | number \| string | none                       | Model of the world object to outline, as a hash or a model name. Without `object` nothing is outlined.                                                                      |
| `object.coords`     | vector3          | `coords`                   | Position of that object. The script outlines the closest object of that model within 3 metres, draws the floating marker above it and points the on-screen indicator to it. |
| `progress.label`    | string           | generic text               | Text on the progress bar.                                                                                                                                                   |
| `progress.duration` | number           | `10000` without `progress` | Length of the task in milliseconds.                                                                                                                                         |
| `progress.anim`     | table            | none                       | Animation played during the task: `dict`, `clip` and optional `flag` (`49` when omitted).                                                                                   |
| `progress.prop`     | table            | none                       | Prop attached during the task: `model`, `pos`, `rot` and optional `bone` (`60309` when omitted).                                                                            |
| `scenario`          | string           | none                       | Name of a GTA scenario. When set, the scenario plays instead of `progress.anim`; `progress.label` and `progress.duration` still apply (`8000` when omitted).                |

The player cannot move, sprint, fight or cancel while the bar runs.

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

```lua
cleaning = {
    {
        coords = vec3(1719.5890, 2501.6196, 45.0116),
        name = "Cleaning - Trash barrel",
        object = { model = 344662182, coords = vec3(1719.5890, 2501.6196, 45.0116) },
        progress = {
            label = "Picking up trash...",
            duration = 7000,
            anim = { dict = "amb@world_human_janitor@male@base", clip = "base" },
        },
    },
},
```

{% endcode %}

{% hint style="success" %}
Run `/taskcoords` in game, aim at an object and press <kbd>G</kbd>. A full task entry with the model and coordinates is copied to your clipboard. Paste it into a category and change `name` and `progress`. See [Commands & permissions](/scripts/core/cuxial-cmservices/commands.md#task-mapping-tool).
{% endhint %}

## Jail · `JAIL`

| Option      | Type       | Default | What it does                                                                                    |
| ----------- | ---------- | ------- | ----------------------------------------------------------------------------------------------- |
| `cells`     | vector3\[] | example | Cell positions. Each jailed player gets one at random.                                          |
| `outCoords` | vector3    | example | Exit point. The player is moved here when the time is served or when staff remove the sanction. |
| `distance`  | number     | `50`    | Maximum distance in metres from the cell. A player who goes further is brought back to it.      |

## Common changes

### Move the community service zone

1. Stand where sanctioned players should appear and copy the position into `COMSERV.coords`.
2. Walk the perimeter and write each corner into `polyZone.points`, in order.
3. Keep `polyZone.debug = true` to see the walls, restart the resource and check that every task is inside.
4. Set `polyZone.debug = false` when the shape is right.

### Make tasks longer or shorter

Change `progress.duration` of each task. The value is in milliseconds: `7000` is seven seconds.

### Use a scenario instead of an animation

```lua
{
    coords = vec3(1700.0, 2550.0, 45.0),
    name = "Gardening - Flower bed",
    scenario = "WORLD_HUMAN_GARDENER_PLANT",
    progress = { label = "Planting...", duration = 6000 },
},
```

### Keep players closer to their cell

Lower `JAIL.distance`. The radius is measured from the cell the player was given.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cuxial.com/scripts/core/cuxial-cmservices/configuration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
