> 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/trabajos/cuxial-diving/installation.md).

# Instalación

Instala Cuxial Diving paso a paso: dependencias, ítems, convars y orden de arranque.

Cuxial Diving necesita tres carpetas, seis ítems de inventario y ningún SQL. Crea sus propias tablas en el primer arranque.

{% stepper %}
{% step %}

## Comprueba las dependencias

Estos recursos tienen que estar instalados y funcionando antes de añadir el trabajo:

* `ox_lib`
* `oxmysql`
* `cuxial_bridge`, con uno de los frameworks soportados: QBox, QBCore o ESX
* `sleepless_interact`
* Tu inventario. El archivo de ítems de este script está escrito para `ox_inventory`.
* OneSync activado en el servidor

`cuxial_garages` es opcional. Si está en marcha, cada miembro de la tripulación recibe las llaves del barco al empezar el trabajo y las pierde al terminar. Sin él, el script no reparte llaves.
{% endstep %}

{% step %}

## Copia los recursos

El paquete trae tres carpetas. Colócalas todas dentro de tu directorio `resources` y conserva sus nombres:

* `cuxial_jobs`
* `cuxial_diving_assets`
* `cuxial_diving`

{% hint style="info" %}
`cuxial_jobs` lo comparten todos los trabajos de Cuxial. Si ya lo tienes de otro trabajo, quédate con la copia más reciente.
{% endhint %}
{% endstep %}

{% step %}

## Añade los ítems

Añade estas entradas a la lista de ítems de `ox_inventory`. Las mismas entradas están en `install/items.lua`.

{% code title="ox\_inventory/data/items.lua" %}

```lua
['scuba_tube_l1'] = {
    label = 'Scuba Tank L1',
    weight = 1000,
    stack = false,
    close = true,
    description = 'Oxygen for about 5 minutes underwater',
},

['scuba_tube_l2'] = {
    label = 'Scuba Tank L2',
    weight = 2000,
    stack = false,
    close = true,
    description = 'Oxygen for about 8 minutes underwater',
},

['scuba_tube_l3'] = {
    label = 'Scuba Tank L3',
    weight = 3000,
    stack = false,
    close = true,
    description = 'Oxygen for about 11 minutes underwater',
},

['scuba_gear'] = {
    label = 'Diving Mask',
    weight = 500,
    stack = false,
    close = true,
    description = 'Mask with a torch. Needs a tank equipped',
},

['liftbag'] = {
    label = 'Lift Bag',
    weight = 1000,
    stack = true,
    close = true,
    description = 'Raises crates from the seabed to the surface',
},

['diamond_ring'] = {
    label = 'Diamond Ring',
    weight = 100,
    stack = true,
    close = true,
    description = 'Found on the seabed',
},

['dendrogyra_coral'] = {
    label = 'Pillar Coral',
    weight = 200,
    stack = true,
    close = true,
    description = 'Coral cut from the reef',
},

['antipatharia_coral'] = {
    label = 'Black Coral',
    weight = 200,
    stack = true,
    close = true,
    description = 'Rare coral cut from the reef',
},

['rolex'] = {
    label = 'Luxury Watch',
    weight = 150,
    stack = true,
    close = true,
},

['goldbar'] = {
    label = 'Gold Bar',
    weight = 1000,
    stack = true,
    close = true,
},
```

{% endcode %}

Después copia las imágenes de `install/images/` a `ox_inventory/web/images/`.

{% hint style="warning" %}
Si tu inventario ya tiene `rolex` o `goldbar`, no los repitas. Abrir una maleta necesita `WEAPON_KNIFE`, que viene con `ox_inventory`.
{% endhint %}

No añadas un bloque `server` ni `client` a las botellas ni a la máscara. El script registra su uso por su cuenta.
{% endstep %}

{% step %}

## Define las convars

Todas son opcionales.

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

```cfg
# Idioma del trabajo (se incluyen en y es)
setr ox:locale "es"

# Webhook de Discord para los registros del trabajo
set cuxial_diving_webhook "https://discord.com/api/webhooks/..."

# Trazas de depuración en la consola
setr cuxial_diving_debug "0"
```

{% endcode %}

{% hint style="info" %}
El webhook va en `server.cfg`, nunca en `shared/config.lua`. El nombre de la convar se puede cambiar en `logs.convar`.
{% endhint %}
{% endstep %}

{% step %}

## Arranca los recursos

Arranca el trabajo después de sus dependencias. Tu framework, tu inventario y `sleepless_interact` tienen que estar en marcha antes.

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

```cfg
ensure ox_lib
ensure oxmysql
# tu framework aquí (qbx_core, qb-core o es_extended)
ensure ox_inventory
ensure sleepless_interact
ensure cuxial_bridge
# opcional
ensure cuxial_garages
ensure cuxial_jobs
ensure cuxial_diving_assets
ensure cuxial_diving
```

{% endcode %}

No hay SQL que ejecutar. Al arrancar, el trabajo crea `cuxial_jobs_players`, `cuxial_jobs_runs`, `cuxial_jobs_run_members` y `cuxial_jobs_audit`. Estas tablas las comparten todos los trabajos de Cuxial.

{% hint style="danger" %}
`cuxial_diving` no arranca si en el servidor falta `cuxial_jobs`, `cuxial_diving_assets` o `sleepless_interact`. Mantén `cuxial_jobs` por encima de `cuxial_diving` en el orden de arranque.
{% endhint %}
{% endstep %}

{% step %}

## Comprueba que funciona

1. Arranca el servidor y lee la consola. Una línea que avisa de ítems que no existen en el inventario significa que el paso de los ítems está incompleto.
2. Ve al NPC del trabajo. Su posición es `npc.coords` en `shared/config.lua`, y tiene un blip en el mapa.
3. Interactúa con el NPC. Se abre el panel con la tripulación, las regiones y el mercado.
4. Compra una botella en el mercado, elige la primera región y empieza el trabajo. Apareces en el barco.
5. Levántate del asiento y usa la botella desde el inventario. Aparece el indicador de oxígeno. El equipo no se puede poner estando sentado.
   {% endstep %}
   {% endstepper %}

Siguiente: ajusta el trabajo a tu servidor en [Configuración](/scripts/es/trabajos/cuxial-diving/configuration.md).


---

# 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/trabajos/cuxial-diving/installation.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.
