> 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/jobs/cuxial-diving/commands.md).

# Commands & permissions

Commands, keys and permissions of Cuxial Diving, and who can use each one.

Cuxial Diving adds two player commands and three staff commands. Everything else is done from the job NPC and with keys.

## Commands

| Command               | Who            | What it does                                                                                                               |
| --------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `/divinggear`         | Everyone       | Takes off the tank and the mask. The tank is not returned.                                                                 |
| `/divingreset`        | Crew owner     | Resets the job in progress. The boat is removed, nobody is paid and the job is saved in the history as reset.              |
| `/divinglist`         | Staff, console | Lists the crews: number, members, region and phase.                                                                        |
| `/divingclose <crew>` | Staff, console | Closes the crew with that number. A job in progress is cancelled without payment.                                          |
| `/divingfast [count]` | Staff          | Completes the required tasks of your own job: `count` pieces per task, or all of them if omitted. Only with debug enabled. |

{% hint style="info" %}
`<crew>` is required and `[count]` is optional. The crew number is the one shown by `/divinglist`. Command names can be changed, or the command disabled, in the `commands` block of `shared/config.lua`.
{% endhint %}

{% hint style="warning" %}
`/divingfast` only works when debug is on at the moment the resource starts: `debug = true` in `shared/config.lua`, or the convar `cuxial_diving_debug` set to `1` before starting. Do not leave it on in a live server.
{% endhint %}

## Keys

| Key                  | What it does                                                                                              |
| -------------------- | --------------------------------------------------------------------------------------------------------- |
| <kbd>H</kbd>         | Drops or raises the anchor. Only while seated in the job boat.                                            |
| <kbd>E</kbd>         | Delivers the boat at the drop-off point, throws the rope to a floating box, and closes the final summary. |
| <kbd>Y</kbd>         | Accepts a crew invite.                                                                                    |
| <kbd>N</kbd>         | Declines a crew invite.                                                                                   |
| <kbd>Backspace</kbd> | Hides the tip on screen.                                                                                  |

These are the defaults of the `keys` block. Each player can rebind them in the GTA settings, under key bindings for FiveM.

## Interactions

| Where               | Option          | Requirement                                                   |
| ------------------- | --------------- | ------------------------------------------------------------- |
| Job NPC             | Diving job      | Be allowed to do the job (`job` in the config).               |
| Coral               | Cut coral       | Job in progress, at the site.                                 |
| Trash               | Collect trash   | Job in progress, at the site.                                 |
| Suitcase            | Open suitcase   | Hold the weapon set in `suitcase.weapon`, a knife by default. |
| Open suitcase       | Loot suitcase   | None.                                                         |
| Box on the seabed   | Attach lift bag | Carry a lift bag. It is spent, along with some oxygen.        |
| Box with a lift bag | Raise box       | None.                                                         |

Once a box floats, the rope is thrown with <kbd>E</kbd> from the boat, with the anchor down.

## Gear

The tanks and the mask are used from the inventory.

* A tank fills the oxygen and is spent on use. Using another tank fills it again.
* The mask needs a tank on. It lets the player breathe underwater and turns on the light.
* The gear cannot be put on inside a vehicle.
* With `gear.requireRun = true`, the default, the gear only works during a job.
* The gear is removed when the job ends, when the oxygen runs out or with `/divinggear`.

## Crew roles

| Action                                                  | Who                                                                   |
| ------------------------------------------------------- | --------------------------------------------------------------------- |
| Invite and kick players, pick the region, start the job | Crew owner                                                            |
| Share the money by percentage                           | Crew owner, with `crew.splitRewards = true`                           |
| Reset the job                                           | Crew owner                                                            |
| Deliver the boat                                        | Any member seated in the boat                                         |
| Leave the crew                                          | Any member. The owner cannot leave during a job: they reset it first. |

If the owner disconnects during a job, another connected member becomes the owner. If nobody is left connected, the job is cancelled.

## Permissions

| Feature                                      | Requirement                                                                 |
| -------------------------------------------- | --------------------------------------------------------------------------- |
| Open the panel, join a crew, use the gear    | Have a job allowed by `job` in `shared/config.lua`. With `'all'`, everyone. |
| Pick a region                                | Every member of the crew at the region's `minLevel` or above.               |
| `/divinglist`, `/divingclose`, `/divingfast` | Belong to the group set in `restricted`, `group.admin` by default.          |

To give the staff commands to another group, change `restricted` in the `commands` block:

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

```lua
commands = {
    gear = { name = 'divinggear' },
    reset = { name = 'divingreset' },
    list = { name = 'divinglist', restricted = 'group.mod' },
    close = { name = 'divingclose', restricted = 'group.mod' },
    fast = { name = 'divingfast', restricted = 'group.admin' },
},
```

{% endcode %}

A player belongs to a group through the usual lines of `server.cfg`:

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

```cfg
add_principal identifier.license:xxxxxxxx group.admin
```

{% endcode %}


---

# 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/jobs/cuxial-diving/commands.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.
