Diving
Installation

Installation

Prerequisites

  • A working Qbox server
  • A running MySQL/MariaDB instance
  • The following resources installed and started:
    • qbx_core
    • ox_lib
    • ox_inventory
    • ox_target
    • oxmysql
    • qbx_vehiclekeys

Steps

1. Drop the resource folder

Place the medit8z_diving folder into resources/[scripts]/.

2. Merge items into Ox Inventory

Open the shipped medit8z_diving/items.lua and merge the three script items into:

resources/[ox]/ox_inventory/data/items.lua

The shipped items are scuba_tank, tank_refill, and diving_pick. The crowbar used by the Medical crate is the vanilla WEAPON_CROWBAR — already present in ox_inventory/data/weapons.lua, no merge needed.

⚠️

scuba_tank carries a client.event hook pointing at diving:client:toggleTank, and tank_refill carries one pointing at diving:client:useRefill. Preserve both hooks exactly as written when merging — the inventory uses them to route item-use events back into the resource. Without them, the items will appear inert when used.

The lootTables in config.lua reference jewelry, medical, crafting, drugs, and heist-tool items already shipped in the same items.lua. If your server already has these items registered, you can skip the duplicates; otherwise merge those too.

3. Copy the icons

Copy every PNG from medit8z_diving/images/ into:

resources/[ox]/ox_inventory/web/images/

4. Ensure the resource

Confirm [scripts] is ensured in server.cfg (default in a Qbox install), or add an explicit line:

ensure medit8z_diving

Database

The diving_boats table is created automatically on first start. server/main.lua reads install.sql at runtime — no manual SQL import is required.

To do a clean reset of boat persistence:

DROP TABLE diving_boats;

The table will be recreated on the next resource start.

Verifying the install

On first start you should see:

[Diving] install.sql executed (1 statements)
[Diving] Dive shop "diving_shop" registered with 4 items
[Diving] All loot table and shop items validated successfully
[Diving] Resource started, spawned crates in 7 zones.

If validation fails, the resource will list which items can't be found in ox_inventory. That always means step 2 is incomplete.

To smoke-test in-game:

  1. Visit the dive NPC (default Vespucci Beach pier — vec3(-807.24, -1497.67, 0.6)).
  2. Buy a scuba_tank, tank_refill, WEAPON_CROWBAR, and diving_pick.
  3. Rent a boat, drive to any zone blip, dive, and search a crate.