> 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/es/interfaz/cuxial-pausemenu/developers.md).

# Exports y eventos

API pública de Cuxial Pause Menu: el estado del jugador que indica si tiene el menú o el mapa abierto.

Cuxial Pause Menu no tiene exports ni eventos para otros recursos. Lo que ofrece es un estado del jugador que puedes leer.

## Estado del jugador: pauseState

El servidor mantiene en cada jugador un state bag replicado que indica si tiene el menú o el mapa abierto. Úsalo para no actuar sobre un jugador que no está mirando el juego.

| Valor           | Significado                                  |
| --------------- | -------------------------------------------- |
| `'menu'`        | El menú o los ajustes de GTA están abiertos. |
| `'map'`         | El mapa de GTA está abierto.                 |
| `false` o `nil` | Nada abierto.                                |

{% tabs %}
{% tab title="Cliente" %}

```lua
local state = Player(serverId).state.pauseState

if state == 'menu' or state == 'map' then
    -- ese jugador está en pausa
end
```

{% endtab %}

{% tab title="Servidor" %}

```lua
local state = Player(source).state.pauseState

if state then
    -- ese jugador está en pausa
end
```

{% endtab %}
{% endtabs %}

Para reaccionar cuando cambia:

```lua
AddStateBagChangeHandler('pauseState', nil, function(bagName, _, value)
    local player = GetPlayerFromStateBagName(bagName)
    if player == 0 then return end
    print(player, value)
end)
```

{% hint style="warning" %}
El estado solo se escribe con `aura.enabled = true`. No se pone mientras el jugador está muerto o abatido con `aura.clearOnDeath = true`. Solo léelo; el recurso sobrescribe cualquier otro valor.
{% endhint %}


---

# 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/es/interfaz/cuxial-pausemenu/developers.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.
