> For the complete documentation index, see [llms.txt](https://docs.privalo.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.privalo.dev/scripts/essentials/guidebook/exports.md).

# EXPORTS

#### 🌉 Bridge (editable sin desencriptar)

Estos archivos están en `escrow_ignore` — se pueden editar aunque el recurso esté encriptado:

* **`bridge/server.lua`** → `PV_IsAdmin(src)` — cambia aquí tu sistema de permisos de staff.
* **`bridge/client.lua`** → `PV_Notify(desc, type)` — cambia el sistema de notificaciones.

Ejemplo — permisos custom por trabajo (QBX):

```lua
function PV_IsAdmin(src)
    if IsPlayerAceAllowed(src, Config.AdminAce) then return true end
    local ok, p = pcall(function() return exports.qbx_core:GetPlayer(src) end)
    return ok and p and p.PlayerData.job.name == 'admin'
end
```

#### 📤 Exports — SERVIDOR

| Export                                                        | Devuelve | Descripción                                                                               |
| ------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------- |
| `exports.pv_guidebook:GetBook()`                              | `table`  | Libro completo `{ {id, label, icon, pages = {{id, title, content}}} }`                    |
| `exports.pv_guidebook:SetPage(categoryLabel, title, content)` | `true`   | Crea o actualiza una página. Si la categoría no existe, la crea. Refresca a los lectores. |

#### 📤 Exports — CLIENTE

| Export                             | Descripción                                    |
| ---------------------------------- | ---------------------------------------------- |
| `exports.pv_guidebook:open()`      | Abre el guidebook (modo lectura)               |
| `exports.pv_guidebook:openAdmin()` | Abre el editor (valida permiso en el servidor) |
| `exports.pv_guidebook:close()`     | Cierra el guidebook                            |
| `exports.pv_guidebook:isOpen()`    | `true` / `false`                               |

#### 🧪 Ejemplo: changelog automático desde otro recurso

```lua
-- En cualquier server.lua de tu recurso:
exports.pv_guidebook:SetPage('Changelog', 'Actualización 2026-07-13', [[
# Novedades

- Nuevo trabajo de granjero
- Arreglos en el banco

{% hint style="success" %}
¡Gracias por jugar!
{% endhint %}
]])
```

Al ejecutarse, la página aparece **al instante** para todos los que tengan `/normas` abierto.

#### 🧪 Ejemplo: abrir el guidebook desde otro script

```lua
-- Cliente
exports.pv_guidebook:open()

-- Al pulsar F5 (ejemplo)
RegisterCommand('doclive', function()
    if exports.pv_guidebook:isOpen() then
        exports.pv_guidebook:close()
    else
        exports.pv_guidebook:open()
    end
end)
RegisterKeyMapping('doclive', 'Abrir docs del server', 'keyboard', 'F5')
```


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.privalo.dev/scripts/essentials/guidebook/exports.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
