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

# Commands & permissions

Keys of the dialogue and the shop of Cuxial Interactions, and who can talk to each NPC.

Cuxial Interactions registers no commands. Players use it by aiming at an NPC; who can do so is decided by the conditions of each point.

## Commands

There are none, for players or for staff.

## Keys

| Key                          | What it does                                                                                   |
| ---------------------------- | ---------------------------------------------------------------------------------------------- |
| Target key                   | Shows the option to talk when aiming at the NPC. It is the key of your target resource.        |
| <kbd>E</kbd>                 | Opens the conversation in sprite mode. Default from `sprite.key` and `sprite.control`.         |
| <kbd>1</kbd> to <kbd>9</kbd> | Picks the dialogue button in that position. From the tenth button on, only the mouse works.    |
| Mouse click                  | Selects a button. A click anywhere shows the whole text at once while it is still being typed. |
| <kbd>Esc</kbd>               | Closes the dialogue or the shop.                                                               |

The resource registers no key binding of its own, so nothing appears in the GTA key settings.

## In the shop

| Action            | What happens                                                                         |
| ----------------- | ------------------------------------------------------------------------------------ |
| Choose a quantity | Up to the units the player carries, and never more than `shop.maxQuantity` per sale. |
| Sell              | The server removes the items and pays `price × quantity` to the account of the shop. |
| Back              | Returns to the dialogue. Only shown when the shop was opened from a dialogue button. |

A sale is rejected when the player is further than the distance of the shop, does not carry the units, or sells again before `shop.cooldown` has passed. Each case shows its own notification.

## Permissions

Cuxial Interactions adds no ACE permissions. Access depends on the conditions written in each point and each button:

| Condition                             | Requirement                              |
| ------------------------------------- | ---------------------------------------- |
| `job = 'police'`                      | Have that job.                           |
| `job = { 'police', 'ambulance' }`     | Have any of the jobs listed.             |
| `job = { police = 2 }`                | Have that job with that grade or higher. |
| `item = 'lockpick'`                   | Carry at least one unit of the item.     |
| `item = { 'lockpick', 'phone' }`      | Carry all the items listed.              |
| `item = { lockpick = 3 }`             | Carry at least that many units.          |
| `canInteract = function(ctx) ... end` | Your own check. It must return `true`.   |

When a point sets several conditions, all of them must pass. A point that fails shows no option to talk. A button that fails is not shown and cannot be run.

{% hint style="info" %}
The `job` field of a dialogue page is different: it is the role shown in the header next to the NPC name, not a condition.
{% endhint %}

## Debug

Set `debug = true` in `shared/config.lua`, or the convar below, to print the points and shops registered and each sale.

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

```cfg
setr cuxial_interactions_debug "1"
```

{% 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/core/cuxial-interactions/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.
