scuba diving
Requirements, install steps, items and first start for scuba diving, a FiveM activity where players gear up, follow a hotspot out to sea and bring crates up from the seabed.
scuba diving (lation_diving) sends players out to sea for crates. They buy scuba gear from a clerk on the docks, rent a boat if they need one, and dive alone or as a group: a message on their phone marks a hotspot, and the crates on the seabed there open into loot that gets better as they level up. The air in their tank runs down for as long as they're under. Everything is set in Lua files under config/.
Works on Qbox, QBCore and ESX.
Requirements
| Resource | Needed | What for |
|---|---|---|
oxmysql | Required | Each player's level, XP and stats |
ox_lib | Required | Callbacks, zones, the language files, and the default menus, notifications, progress bars, dialogs and underwater readout |
qbx_core, qb-core or es_extended | Required | Players, jobs, money and usable items |
| An inventory | Required | ox_inventory, qb-inventory, qs-inventory, ps-inventory, origen_inventory, codem-inventory, core_inventory, tgiann-inventory or jaksam_inventory. The air in the scuba gear and the oxygen tank is kept on the item, so the inventory has to keep item metadata. |
ox_target, qb-target or interact | Required | The clerk, the crates and the boat's anchor. Set which one in setup.interact. lation interact answers as ox_target and qb-target, so it works with either setting. |
lation_ui | Optional | Menus, dialogs, notifications, progress bars and the underwater readout in the lation ui look. Each one is ox_lib until you pick it. |
| A phone | Optional | The hotspot messages: lb-phone, qb-phone, qs-smartphone-pro, qs-smartphone, gksphone, roadphone, npwd, yseries or okokPhone. Without one, the messages show as a dialog on screen. |
| A vehicle keys script | Optional | Keys to the rental boat: qb-vehiclekeys, cd_garage, wasabi_carlock, qbx_vehiclekeys, vehicles_keys, okokGarage, qs-vehiclekeys, Renewed-Vehiclekeys, t1ger_keys or MrNewbVehicleKeys |
| A fuel script | Optional | A full tank in the rental boat: LegacyFuel, ox_fuel, cdn-fuel, x-fuel, okokGasStation, rcore_fuel, qs-fuelstations or ps-fuel |
okokNotify, wasabi_notify or sd-notify | Optional | Other notification systems |
jg-textui or okokTextUI | Optional | Other text prompts for the underwater readout |
fmsdk or fm-logs | Optional | Logging to Fivemanage or Fivemerr |
oxmysql and ox_lib are dependencies in fxmanifest.lua. The framework, inventory, phone, keys and fuel scripts are looked for once, when lation_diving starts, so start them before it. The interaction system isn't looked for: it's whatever setup.interact says.
When a player takes the gear off, their own outfit comes back through esx_skin on ESX, qb-clothing on QBCore, or illenium-appearance or fivem-appearance.
Install
Follow the install guide, then:
Keep the folder name lation_diving. A renamed folder prints an error on start and again every 15 minutes.
Add the 27 items and their images to your inventory. The files ship in install/, and the image names match the item names.
Paste the contents of install/items/ox_inventory.txt into ox_inventory/data/items.lua, then copy every file in install/images/ into ox_inventory/web/images/. This is the one to use on Qbox.
Paste the contents of install/items/qb-inventory.txt into qb-core/shared/items.lua, then copy every file in install/images/ into qb-inventory/html/images/.
Paste the contents of install/items/qs-inventory.txt into the item list of qs-inventory, then copy every file in install/images/ into its image folder.
Add the same 27 items in your inventory's own format, with the labels and weights in items below, and copy every file in install/images/ into its image folder. Make the five scuba gear items and the oxygen tank unique (one per slot), since each carries its own air. The usable items are made usable through your framework, so nothing else is needed for them.
Open config/shared.lua and set setup.interact to the interaction system you run: ox_target (the default, and the one to keep with lation interact), qb-target or interact. While you're there, pick lation_ui for the notifications, progress bars, menus and dialogs if you run it. See setup.
Ensure it after your framework, your inventory, your interaction system and the phone, keys and fuel scripts you use. If you run lation ui, it goes first, above ox_lib, because the lation ox_lib fork looks for it when ox_lib starts.
ensure lation_ui # optional
ensure oxmysql
ensure ox_lib
ensure qbx_core # or qb-core / es_extended
ensure ox_target # or lation_interact / qb-target / interact
ensure ox_inventory # your inventory
ensure lb-phone # optional: your phone, keys and fuel scripts
ensure lation_divingRestart the server.
There is no SQL to import. On every start lation_diving runs install/lation_diving.sql, which creates its one table when it's missing. Keep the install folder: without it the console prints an error every 10 seconds.
| Column | Holds |
|---|---|
identifier | The character: the ESX identifier, or the citizenid on Qbox and QBCore |
name | The character's name when the row was made, for the leaderboard |
level, exp | Diving level and total XP |
crates | Crates picked up |
depth | Deepest dive, in the unit set by setup.metric |
swam | Distance swum underwater in scuba gear, in the same unit |
A player's row is made the first time the script looks them up, usually when they first open the menu.
What ships with it
config/holds the four settings files. See configuration.locales/holds English, German and Dutch. See language.bridge/client.lua,bridge/server.lua,client/functions.luaandserver/functions.luaship open, for other frameworks, inventories and UI. See developers.install/holds the items, their images and the SQL file.
Items
| Item | Label | Weight | Usable |
|---|---|---|---|
ls_scuba_gear_1 | Scuba Gear | 4000 | Yes, puts the gear on or takes it off. Level 1. |
ls_scuba_gear_2 | Scuba Gear | 4000 | Yes. Level 2. |
ls_scuba_gear_3 | Scuba Gear | 4000 | Yes. Level 3. |
ls_scuba_gear_4 | Scuba Gear | 4000 | Yes. Level 4. |
ls_scuba_gear_5 | Scuba Gear | 4000 | Yes. Level 5. |
ls_oxygen_tank | Oxygen Tank | 2000 | Refills scuba gear. On ox_inventory it is dragged onto the gear; on other inventories it is used. |
ls_diving_crate | Crate | 1000 | Yes, opens it for loot |
ls_old_boot | Old Boot | 25 | No |
ls_wood_plank | Wood Plank | 25 | No |
ls_rusted_padlock | Rusted Padlock | 25 | No |
ls_rusted_key | Rusted Key | 25 | No |
ls_rusted_gear | Rusted Gear | 25 | No |
ls_seashell | Seashell | 25 | No |
ls_seaweed | Seaweed | 25 | No |
ls_rusted_muffler | Rusted Muffler | 25 | No |
ls_broken_cd | Broken CD | 25 | No |
ls_diving_goggles | Diving Goggles | 25 | No |
ls_fishing_net | Fishing Net | 25 | No |
ls_old_camera | Old Camera | 25 | No |
ls_military_helmet | Military Helmet | 25 | No |
ls_old_compass | Old Compass | 25 | No |
ls_old_watch | Old Watch | 25 | No |
ls_conch_shell | Conch Shell | 25 | No |
ls_bottle_of_rum | Bottle of Rum | 25 | No |
ls_treasure_map | Treasure Map | 25 | No |
ls_silver_bracelet | Silver Bracelet | 25 | No |
ls_ancient_artifact | Ancient Artifact | 25 | No |
The names must match, or be changed in config/shared.lua to match yours: the gear under gear.tanks, the oxygen tank as gear.refill, the crate as crates.item, and the finds in crates.loot and shop.pawn.items.
The scuba gear and the oxygen tank keep their air as durability on the item, so buy them from the dive shop, which hands them out full. One spawned without it won't go on, and F8 says Missing or invalid metadata on scuba gear item. To hand one out yourself, give it the durability key at 100: durability on ox_inventory, durabilityPercent on tgiann-inventory, quality on the others.
The dive shop also sells burger and water by default, which don't ship with scuba diving. If your inventory has no items by those names, the rows read Undefined: rename or remove them under shop.gear.items.
First start
A clerk stands on the docks at -289.3029, -2770.0029, 2.1953 under a Scuba Diving blip. He appears when a player comes within 100 meters.
Talk to him, buy Scuba Gear | Level 1 and an Oxygen Tank in The Dive Shop, then Create Group and Start Diving. See players.
Set the zones, loot, prices and the rest in config/. See configuration.
After changing a config file, restart the script the way config/shared.lua asks: stop lation_diving, wait a couple of seconds, then ensure lation_diving, rather than restart lation_diving. Levels and stats are saved when a player leaves, when the resource stops and when txAdmin shuts the server down.
Troubleshooting
Players don't get the hotspot message
With lb-phone, the player needs an email address set up in the phone's Mail app; without one, nothing arrives. Start your phone before lation_diving, since the phone is looked for when it starts. With no supported phone running, the messages show as a dialog on screen instead.
F8 says Missing or invalid metadata on scuba gear item
The scuba gear or oxygen tank has no durability on it, usually because it was spawned instead of bought. Buy one from the dive shop, or give it the durability key at 100 (see items).
A dive shop row says Undefined
Your inventory has no item by that name. By default these are burger and water. Change or remove them under shop.gear.items.
F8 says No vehicle keys detected or No fuel system detected
None of the supported keys or fuel scripts was running when lation_diving started. The boat still spawns; start your keys and fuel scripts before lation_diving, or add yours in client/functions.lua (see developers).
The console says install folder or .sql files missing
The install folder or install/lation_diving.sql was deleted. Put it back from the download; the script runs it on every start.
The console says to rename the folder
The resource folder isn't named lation_diving. Rename it back and restart; the message repeats every 15 minutes until you do.
The clerk's blip shows the wrong icon
The default sprite, 729, isn't in older game builds. Update your game build and server artifacts, or pick another sprite in blips.start.sprite in config/client.lua.
The console says Unable to fetch version information from API
The update check couldn't reach the version server. It changes nothing in game. Set setup.version to false to skip it.
Still stuck? Ask in our Discord: the people who write the scripts answer.
Last updated
Changelog
Every metal detecting release since version 2, newest first, with what it added, changed and fixed.
Players
How players use scuba diving with the default settings, from the clerk's menu and the dive shop to scuba gear and air, groups, a dive, opening crates, the pawn shop, the rental boat and levels.