> 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/installation.md).

# Installation

Install Cuxial Community Service step by step: dependencies, SQL, staff permissions and start order.

Cuxial Community Service needs one SQL table and no inventory items. It has no convars.

{% stepper %}
{% step %}

## Check the dependencies

These must be installed and working before you add the script:

* `ox_lib`
* `oxmysql`
* `cuxial_bridge`, running on QBox or QBCore
* `bl_sprites`
* OneSync enabled on the server

Two integrations are optional and detected on their own:

* `cuxial_chat`: sanctions are announced in its sanctions channel. Without it they are announced in the standard chat.
* `wais-hudv6`: the radar is shown while the player is inside the community service zone.
  {% endstep %}

{% step %}

## Copy the resource

Place the `cuxial_cmservices` folder inside your `resources` directory.

{% hint style="danger" %}
Keep the folder name exactly as `cuxial_cmservices`. The resource stops itself when it runs under another name.
{% endhint %}
{% endstep %}

{% step %}

## Import the SQL

Run `cuxial_cmservices.sql`, included in the resource, on your database.

{% tabs %}
{% tab title="New installation" %}
{% code title="cuxial\_cmservices.sql" %}

```sql
CREATE TABLE IF NOT EXISTS `cuxial_cmservices` (
  `citizenid` varchar(50) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
  `comserv` text,
  `jail` text
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;
```

{% endcode %}
{% endtab %}

{% tab title="Existing punishments table" %}
If your database already has a `punishments` table with these three columns and you want to keep its records, rename it instead of creating a new one:

```sql
RENAME TABLE `punishments` TO `cuxial_cmservices`;
```

{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

## Give your staff the permission

The commands are restricted to the ACE group `group.mod`, and the server also checks the `mod` permission of your framework.

{% code title="server.cfg" %}

```cfg
# Moderators hold the "mod" permission
add_ace group.mod mod allow

# Admins inherit everything moderators can do
add_principal group.admin group.mod

# One line per staff member
add_principal identifier.license:xxxxxxxxxxxxxxxx group.mod
```

{% endcode %}

If your server already defines these groups, only add the staff members who are missing. See [Commands & permissions](/scripts/core/cuxial-cmservices/commands.md).
{% endstep %}

{% step %}

## Adjust the zones

Open `config/shared.lua` and review the community service zone, the jail cells and the exit points. The values delivered are an example location.

Set `polyZone.debug = false` before opening the server to players. With `true` the walls of the zone are drawn in the world, which helps while you adjust the polygon.

Every option is explained in [Configuration](/scripts/core/cuxial-cmservices/configuration.md).
{% endstep %}

{% step %}

## Start the resource

Start it after its dependencies and after your framework:

{% code title="server.cfg" %}

```cfg
ensure ox_lib
ensure oxmysql
# your framework here (qbx_core or qb-core)
ensure cuxial_bridge
ensure bl_sprites
# optional
ensure cuxial_chat
ensure cuxial_cmservices
```

{% endcode %}
{% endstep %}

{% step %}

## Check that it works

1. Join with a staff account and run `/sanciones`. The panel opens.
2. Run `/comserv` with your own id, `2` tasks and a reason. You are moved to the zone and the first task appears on the map.
3. Walk to the interaction point and press <kbd>E</kbd>. The progress bar runs and the counter drops.
4. Finish the second task. You are moved to the exit point.
5. Run `/jaila` with your own id, `1` minute and a one-word reason. You are moved to a cell and released a minute later.
   {% endstep %}
   {% endstepper %}

Next: move the zones and write your own tasks in [Configuration](/scripts/core/cuxial-cmservices/configuration.md).


---

# 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/installation.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.
