Cuxial Diving needs three folders, ten inventory items (eight required, two optional) and no SQL import. It creates its own tables on first start.
Check the dependencies
These resources must be installed and working before you add the job:
ox_liboxmysqlcuxial_bridge, with one of the supported frameworks: QBox, QBCore or ESXsleepless_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.
Copy the resources
The package contains a single folder, [cuxial_jobpack]. Place it inside your resources directory and keep its name. It holds cuxial_jobs, the three jobs (cuxial_diving, cuxial_electrician and cuxial_gardener) and their assets.
If you already have cuxial_jobs from another Cuxial job, replace it with the one in the pack. You only need to start the jobs you use.
Add the items
Add these entries to the item list of ox_inventory. The same entries are in install/items.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,
},Then copy the pictures from install/images/ to ox_inventory/web/images/.
If your inventory already has rolex or goldbar, do not add them twice. Opening a suitcase needs WEAPON_KNIFE, which comes with ox_inventory.
Do not add a server or client block to the tanks or the mask. The script registers their use by itself.
Set the convars
All of them are optional.
# 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"The webhook goes in server.cfg, never in shared/config.lua. The name of the convar can be changed in logs.convar.
Start the resources
Start the job after its dependencies. Your framework, inventory and sleepless_interact must be running before it.
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_divingNo 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.
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.
Check that it works
- 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.
- Go to the job NPC. Its position is
npc.coordsinshared/config.lua, and it has a blip on the map. - Interact with the NPC. The panel opens with the crew, the regions and the market.
- Buy a tank in the market, pick the first region and start the job. You are placed on the boat.
- Get up from the seat and use the tank from your inventory. The oxygen indicator appears. The gear cannot be put on while seated.
Next: adjust the job to your server in Configuration.
