> 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/leisure/cuxial-pvp/commands.md).

# Commands & permissions

Commands, keys and permissions of Cuxial PvP, and how to draw Gun Game zones.

Player commands are open to everyone. Only saving a zone needs a permission.

## Commands

| Command                   | Who                          | What it does                                                |
| ------------------------- | ---------------------------- | ----------------------------------------------------------- |
| `/Cuxiall`                | Everyone                     | Opens the menu. Not available during a match.               |
| `/exitduel`               | Players in a match           | Leaves the current match. Can be used once every 5 seconds. |
| `/pvpzone gungame <name>` | Staff with `cuxialpvp.zones` | Opens the zone tool to draw a Gun Game zone.                |

{% hint style="info" %}
The three names can be changed in `commands` of `data/config.lua`.
{% endhint %}

What `/exitduel` does depends on the game mode:

* **Duel.** The match ends for everyone. Bets are refunded and the match does not count for the leaderboard.
* **Gun Game.** Only that player leaves. The match goes on while 2 players remain.

## Keys

Every key below can be rebound by each player in the FiveM key settings.

| Key                       | When           | What it does                               |
| ------------------------- | -------------- | ------------------------------------------ |
| Unassigned                | Any time       | Opens the menu. Listed as "Open CuxiaPvP". |
| <kbd>TAB</kbd> (hold)     | In a match     | Shows the scoreboard.                      |
| <kbd>←</kbd> <kbd>→</kbd> | Dead in a duel | Switches the camera between teammates.     |
| <kbd>←</kbd> <kbd>→</kbd> | Spectating     | Switches the camera between players.       |
| <kbd>Backspace</kbd>      | Spectating     | Stops spectating.                          |

## Zone tool

Gun Game is played inside zones drawn in game.

```
/pvpzone gungame Harmony
```

The command opens a free camera. Aim at the ground and build the outline point by point:

| Key                       | What it does                  |
| ------------------------- | ----------------------------- |
| Left click                | Adds a corner where you aim.  |
| Right click               | Removes the last corner.      |
| Mouse wheel               | Raises or lowers the ceiling. |
| <kbd>↑</kbd> <kbd>↓</kbd> | Raises or lowers the floor.   |
| <kbd>Enter</kbd>          | Saves the zone.               |
| <kbd>Backspace</kbd>      | Cancels.                      |

A zone needs at least three corners. Once saved it joins the rotation at once, with no restart, and is written to `data/gungame_zones.lua`.

The zone tool cannot be opened during a match.

## Permissions

| Permission        | Type | Grants                              |
| ----------------- | ---- | ----------------------------------- |
| `cuxialpvp.zones` | ACE  | Saving zones drawn with `/pvpzone`. |

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

```cfg
add_ace group.admin cuxialpvp.zones allow
```

{% endcode %}

The name of the permission can be changed in `zoneToolAce` of `data/config.lua`.

Everything else depends on the player's situation:

| Action                             | Requirement                                                         |
| ---------------------------------- | ------------------------------------------------------------------- |
| Create a lobby                     | Not hosting another lobby, and the server below `limits.maxLobbies` |
| Assign players and start the match | Be the host of the lobby                                            |
| Join a lobby                       | Not be in a match, know the password if there is one, and room left |
| Spectate                           | Not be in a match, and the match created with spectators on         |
| Bet                                | Enough cash, and no previous bet on that match                      |


---

# 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/leisure/cuxial-pvp/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.
