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

# Installation

Install Cuxial Diving step by step: dependencies, items, convars and start order.

Cuxial Diving needs three folders, six inventory items and no SQL import. It creates its own tables on first start.

{% stepper %}
{% step %}

## Check the dependencies

These resources must be installed and working before you add the job:

* `ox_lib`
* `oxmysql`
* `cuxial_bridge`, with one of the supported frameworks: QBox, QBCore or ESX
* `sleepless_interact`
* Your inventory. The item file of this script is written for `ox_inventory`.
* OneSync enabled on the server

`cuxial_garages` is optional. When it is running, every crew member gets the keys of the boat when the job starts and loses them when it ends. Without it, the script hands out no keys.
{% endstep %}

{% step %}

## Copy the resources

The package contains three folders. Place all of them inside your `resources` directory and keep their names:

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

{% hint style="info" %}
`cuxial_jobs` is shared by every Cuxial job. If you already have it from another job, keep the most recent copy.
{% endhint %}
{% endstep %}

{% step %}

## Add the items

Add these entries to the item list of `ox_inventory`. The same entries are in `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 %}

Then copy the pictures from `install/images/` to `ox_inventory/web/images/`.

{% hint style="warning" %}
If your inventory already has `rolex` or `goldbar`, do not add them twice. Opening a suitcase needs `WEAPON_KNIFE`, which comes with `ox_inventory`.
{% endhint %}

Do not add a `server` or `client` block to the tanks or the mask. The script registers their use by itself.
{% endstep %}

{% step %}

## Set the convars

All of them are optional.

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

```cfg
# Language of the job (en and es are included)
setr ox:locale "en"

# Discord webhook for the job logs
set cuxial_diving_webhook "https://discord.com/api/webhooks/..."

# Debug traces in the console
setr cuxial_diving_debug "0"
```

{% endcode %}

{% hint style="info" %}
The webhook goes in `server.cfg`, never in `shared/config.lua`. The name of the convar can be changed in `logs.convar`.
{% endhint %}
{% endstep %}

{% step %}

## Start the resources

Start the job after its dependencies. Your framework, inventory and `sleepless_interact` must be running before it.

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

```cfg
ensure ox_lib
ensure oxmysql
# your framework here (qbx_core, qb-core or es_extended)
ensure ox_inventory
ensure sleepless_interact
ensure cuxial_bridge
# optional
ensure cuxial_garages
ensure cuxial_jobs
ensure cuxial_diving_assets
ensure cuxial_diving
```

{% endcode %}

No SQL to run. On start the job creates `cuxial_jobs_players`, `cuxial_jobs_runs`, `cuxial_jobs_run_members` and `cuxial_jobs_audit`. These tables are shared by all Cuxial jobs.

{% hint style="danger" %}
`cuxial_diving` does not start when `cuxial_jobs`, `cuxial_diving_assets` or `sleepless_interact` is missing from the server. Keep `cuxial_jobs` above `cuxial_diving` in the start order.
{% endhint %}
{% endstep %}

{% step %}

## Check that it works

1. Start the server and read the console. A line saying that items do not exist in the inventory means the previous item step is incomplete.
2. Go to the job NPC. Its position is `npc.coords` in `shared/config.lua`, and it has a blip on the map.
3. Interact with the NPC. The panel opens with the crew, the regions and the market.
4. Buy a tank in the market, pick the first region and start the job. You are placed on the boat.
5. Get up from the seat and use the tank from your inventory. The oxygen indicator appears. The gear cannot be put on while seated.
   {% endstep %}
   {% endstepper %}

Next: adjust the job to your server in [Configuration](/scripts/jobs/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/jobs/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.
