Skip to content

Configuration

Every option of Cuxial Diving explained: config, regions, loot, market, gear and progression.

Behaviour lives in shared/config.lua; regions, loot, prices, gear and levels live in the files of data/. Restart the resource after any change.

Coordinates, the NPC, the regions, the items and the prices that come in these files are examples. Change them to fit your server.

General ​

OptionTypeDefaultWhat it does
debugbooleanfalsePrints traces to the console. Also enabled by setting the convar cuxial_diving_debug to 1.
accountstring'bank'Account used for job payouts, daily rewards and the market.
jobstring | string[]'all'Who can do the job. 'all' = everyone. A job name or a list of job names = only those jobs.
logs.convarstring'cuxial_diving_webhook'Name of the convar that holds the Discord webhook. With the convar empty, nothing is sent.
admin.auditDaysnumber60Days the audit rows are kept. Older rows are deleted once a day. Minimum 1.

Interface · ui ​

OptionTypeDefaultWhat it does
accentstring (hex)configurableAccent colour of the panel.
currency.symbolstring'$'Currency symbol shown in the panel.
currency.localestring'en-US'Number format of the amounts, as a language tag ('en-US', 'es-ES'...).

Job NPC · npc ​

The NPC opens the panel and the market.

OptionTypeDefaultWhat it does
coordsvector4examplePosition and heading of the NPC.
modelstring'a_m_y_beach_01'Ped model.
distancenumber2.0Metres from which the interaction is offered.
menuDistancenumber6.0Metres beyond which the server refuses to open the panel.
spawnDistancenumber60.0Metres within which the ped exists for a player.
blip.enabledbooleantruetrue shows the job blip on the map. false hides it.
blip.sprite, blip.color, blip.scalenumber317, 3, 0.55Look of the blip.

Interaction · target ​

OptionTypeDefaultWhat it does
distancenumber3.0Metres from a piece to interact with it.
showDistancenumber35.0Metres within which a marker is drawn above each pending piece. 0 = no marker.
marker.typenumber2Marker type of the game.
marker.scalenumber0.5Size of the marker.
marker.heightnumber0.8Metres above the top of the piece.
marker.colornumber[]configurableColour as { r, g, b, alpha }.
marker.bobbooleantruetrue makes the marker move up and down.
marker.rotatebooleantruetrue makes the marker spin.
iconstableFont Awesome classesIcon of each interaction: menu, coral, trash, open, loot, bag, raise.

Blips · blips ​

OptionTypeDefaultWhat it does
boattablesprite 529, color 0, scale 0.8Blip of the work boat.
delivertablesprite 410, color 2, scale 0.9Blip of the drop-off point.
areatablecolor 77, alpha 90Circle that marks the radius of each task zone.
taskstableone entry per taskBlip of each task: coral, trash, suitcase, box, each with sprite, color and scale.
siteDistancenumber250.0Metres within which the pieces of a zone exist for a player.

Crew · crew ​

OptionTypeDefaultWhat it does
maxPlayersnumber4Maximum crew size.
inviteDistancenumber8.0Metres between the owner and the invited player.
inviteSecondsnumber60Seconds until an invite expires. Minimum 5.
reconnectSecondsnumber180Seconds a seat is kept for a player who disconnects during a job. 0 = removed from the crew at once.
splitRewardsbooleantruetrue lets the owner share the money by percentage from the panel. false hides that option. Experience is never shared this way.

Job · run ​

OptionTypeDefaultWhat it does
cooldownHoursnumber0Hours a player must wait between jobs, counted from the start of the last one. 0 = no wait.
soloHalfbooleantruetrue halves the required tasks (corals and trash) for a crew of one. false keeps the full amount.
spawnFreeRadiusnumber10.0Metres around a spawn point that must be free of vehicles for the boat to appear there.
exclusiveRegionsbooleanfalsefalse lets several crews work in the same region. true allows one crew per region.

Screen fade · fade ​

Used when a player is moved to the boat or back to the NPC.

OptionTypeDefaultWhat it does
outMsnumber600Milliseconds of fade out.
holdMsnumber1500Milliseconds the screen stays black.
inMsnumber800Milliseconds of fade in.
maxMsnumber15000Safety limit. The screen never stays black longer than this.

Boarding · board ​

OptionTypeDefaultWhat it does
seatbooleantruetrue seats each member in a free seat, the owner at the wheel. false leaves them standing on deck.
deckOffsetvector3vec3(0.0, 0.0, 2.0)Position on deck, relative to the boat, when there is no free seat or seat = false.
timeoutMsnumber8000Maximum wait for the boat to exist for the player. Minimum 1000.
reconnectDistancenumber100.0A player who reconnects is placed on the boat only when farther than this, in metres.
returnToNpcbooleantruetrue takes a player back to the NPC when the job ends while they are in the water or on the boat. false leaves them where they are.
npcOffsetnumber1.5Metres in front of the NPC where the player is placed.

Work boat · boat ​

OptionTypeDefaultWhat it does
modelstring'tug'Boat model.
platestring'DIVE'Plate prefix, up to four characters. The job number completes it.
fuelnumber100.0Fuel level set on the boat when it spawns.
keysbooleantruetrue gives the keys to the crew through cuxial_garages when that resource is running. false never gives keys.
spawnTimeoutMsnumber5000Maximum wait for the boat to be created.

Dive site · site ​

The pieces of a task are placed when a crew member gets close to it.

OptionTypeDefaultWhat it does
spawnRadiusnumber150.0Metres from the centre of a task at which its pieces are generated.
maxDepthDeltanumber40.0Metres below the centre of the task where pieces are still accepted.
surfaceZnumber0.0Height of the sea surface. Pieces must be below it.
minSeparationnumber2.0Minimum metres between two pieces.
requestTimeoutMsnumber20000Milliseconds a player has to answer with the positions before another one is asked.
maxAttemptsnumber3Failed attempts per player before the request goes to another crew member.
watchMsnumber1000Milliseconds between proximity checks. Minimum 250.

Collecting · collect ​

OptionTypeDefaultWhat it does
maxDistancenumber4.0Metres from the piece that the server accepts.
progressMstable2800 eachDuration in milliseconds of each action: coral, trash, open, loot, bag.
marginMsnumber500Tolerance in milliseconds when the server checks those durations.
beginTtlMsnumber15000Milliseconds after which a started action expires.

Suitcases · suitcase ​

OptionTypeDefaultWhat it does
weaponstring'WEAPON_KNIFE'Weapon the player must hold to open a suitcase. 'WEAPON_UNARMED' = no requirement.

Boxes · boxes ​

OptionTypeDefaultWhat it does
liftbagItemstring'liftbag'Item spent when a lift bag is attached to a box.
liftbagModelstring'cuxial_diving_liftbag'Lift bag model, from cuxial_diving_assets.
liftbagFallbackstring'prop_byard_float_02'Model used when the main one is not available.
oxygenCostnumber2Oxygen points spent when attaching a lift bag.
surfaceZnumber0.5Height at which a raised box floats.
deckSlotsnumber48Boxes that fit on deck.

Rope · tow ​

The player throws the rope from the boat, seated or standing on deck, with the anchor down.

OptionTypeDefaultWhat it does
maxDistancenumber40.0Maximum metres between the boat and the floating box.
deckRadiusnumber7.0Metres from the boat within which a player counts as on deck.
speednumber5.0Speed of the box while it is pulled, in metres per second.
ropeTypenumber5Rope type of the game.

Delivery · deliver ​

OptionTypeDefaultWhat it does
radiusnumber15.0Metres from the drop-off point of the region at which the boat can be delivered. The player must be seated in the boat.

Payout · reward and loot ​

OptionTypeDefaultWhat it does
reward.modestring'full'How the money of the region is paid. 'full' = the full reward to every member. 'split' = the reward divided by the crew size. 'bonus' = the full reward plus bonusPerExtra for each extra member.
reward.bonusPerExtranumber0.25Extra share per additional member in 'bonus' mode. 0.25 = +25 %.
loot.boxTostring'tower'Who receives the loot of a box. 'tower' = the player who threw the rope. 'deliverer' = the player who delivers the boat, all at once. 'rotate' = connected members in turns.

The crew size counts every member, connected or not. Members who are disconnected at delivery receive nothing. Experience is always paid in full to each connected member.

Gear · gear ​

OptionTypeDefaultWhat it does
consumeMaskbooleanfalsefalse keeps the mask in the inventory after using it. true removes it. Tanks are always spent.
requireRunbooleantruetrue allows the gear only during a job. false allows it at any time.
confirmMsnumber10000Milliseconds the game has to finish putting the gear on. After that the item is returned. Minimum 1000.

Market · market ​

OptionTypeDefaultWhat it does
maxDistancenumber15.0Metres from the NPC within which buying and selling is accepted.
maxAmountnumber100Maximum units per operation.
sellValuablesbooleantruefalse removes from the sell list the entries marked valuable in data/market.lua.

Outfit · outfit ​

OptionTypeDefaultWhat it does
modestring'wetsuit'Clothes worn during the job, from data/outfits.lua. 'wetsuit' = wetsuit. 'classic' = the alternative set of that file. 'none' = the player keeps their own clothes.

The outfit is applied when the job starts and the player's own clothes come back when it ends. It only applies to the freemode male and female models.

Ranking, history and profile ​

OptionTypeDefaultWhat it does
leaderboard.sizenumber10Entries in each ranking. From 1 to 50.
leaderboard.cacheSecondsnumber60Seconds the ranking is kept before it is read again from the database.
history.sizenumber10Jobs shown in a player's history. From 1 to 50.
profile.flushMsnumber30000Milliseconds between saves of experience and daily progress. Money is always paid at once. Minimum 5000.

Commands · commands ​

OptionTypeDefaultWhat it does
gear.namestring | false'divinggear'Name of the command that takes the gear off. false disables it.
reset.namestring | false'divingreset'Name of the command that resets the job. false disables it.
list.name, list.restrictedstring'divinglist', 'group.admin'Name of the command that lists crews and the group allowed to use it.
close.name, close.restrictedstring'divingclose', 'group.admin'Name of the command that closes a crew and the group allowed to use it.
fast.name, fast.restrictedstring'divingfast', 'group.admin'Name of the debug command and the group allowed to use it.

See Commands & permissions for what each one does.

Keys and on-screen help ​

OptionTypeDefaultWhat it does
keys.anchorstring'H'Default key to drop or raise the anchor.
keys.interactstring'E'Default key to deliver the boat, throw the rope and close the final summary.
keys.acceptstring'Y'Default key to accept an invite.
keys.declinestring'N'Default key to decline an invite.
keys.tipHidestring'BACK'Default key to hide a tip.
tips.secondsnumber12Seconds a first-time tip stays on screen. Minimum 3.
finish.secondsnumber15Seconds the final summary stays on screen. Minimum 3.

These keys are only defaults. Each player can rebind them in the GTA settings, under key bindings for FiveM.

Regions · data/regions.lua ​

Each entry is a region the crew can pick.

FieldTypeWhat it does
idnumberStable number of the region. It is saved in the database: do not reuse or renumber it.
labelstringLocale key with the name of the region. It must start with region_.
minLevelnumberMinimum level that every member of the crew must have.
rewardtable{ money, xp } per member. reward.mode decides how the money is paid.
taskstable[]Tasks of the region. See below.
spawnsvector4[]Spawn points of the boat. The first free one is used.
delivervector3Drop-off point of the boat.

Fields of each task:

FieldTypeWhat it does
kindstring'coral', 'trash', 'suitcase' or 'box'.
amountnumberNumber of pieces.
radiusnumberRadius in metres of the zone where the pieces appear.
centervector3Centre of the zone, on the seabed.
countedbooleantrue = the task must be completed to deliver the boat. Without it the task is optional.
data/regions.lua
lua
{
    id = 5,
    label = 'region_reef',
    minLevel = 15,
    reward = { money = 5000, xp = 900 },
    tasks = {
        { kind = 'coral', amount = 25, radius = 40.0, center = vec3(0.0, 0.0, -30.0), counted = true },
        { kind = 'trash', amount = 25, radius = 40.0, center = vec3(0.0, 0.0, -30.0), counted = true },
        { kind = 'suitcase', amount = 10, radius = 40.0, center = vec3(0.0, 0.0, -30.0) },
    },
    spawns = {
        vec4(0.0, 0.0, 0.5, 90.0),
    },
    deliver = vec3(0.0, 0.0, 0.5),
},

Replace the coordinates with real ones and add the key of label to locales/en.json and to the other locale files you use.

Loot · data/loot.lua ​

Three tables: coral (each coral cut), suitcase (each suitcase looted) and box (each box loaded on the boat).

FieldTypeWhat it does
itemstringItem name in your inventory.
chancenumberRelative weight. The weights do not need to add up to 100.
min, maxnumberAmount given, picked at random between both.

Market · data/market.lua ​

FieldTypeWhat it does
buytable[]What the NPC sells: { item, price }.
selltable[]What the NPC buys: { item, price, valuable }. Entries with valuable = true disappear with market.sellValuables = false.

Prices are per unit, in the account set in account. The name and the picture of each item come from your inventory.

Gear · data/gear.lua ​

FieldTypeDefaultWhat it does
tubestable[]three tanksTanks, in level order. Each one has item (usable item), model (prop on the back) and seconds (seconds underwater per oxygen point).
oxygennumber100Oxygen points of a full tank.
lowOxygennumber20Percentage at which the low oxygen warning appears.
mask.itemstring'scuba_gear'Item of the mask.
mask.modelstring'p_d_scuba_mask_s'Prop of the mask.
tank, masktableBone, offset and rotation of each prop on the player.
underwaterMsnumber50000Time the player can stay underwater with oxygen left, as used by the game.
emptyMsnumber10The same value once the oxygen runs out.
equipMsnumber2000Milliseconds of the animation when putting the gear on.
animtableAnimation played while putting the gear on.

With the default values a full tank lasts 5:00, 8:20 and 11:40 minutes underwater. Oxygen is only spent while the player swims underwater.

Daily tasks · data/daily.lua ​

FieldTypeDefaultWhat it does
resetHoursnumber24Hours after which a player's daily tasks start again, counted from their last reset.
taskstable[]three tasksDaily tasks. Fields below.
FieldTypeWhat it does
idstringStable key of the task. It is saved in the database.
labelstringLocale key with the name.
kindstringWhat it counts. 'coral' = corals cut. 'trash' = trash collected. 'runs' = jobs delivered. 'money' = money earned from jobs. 'team' = jobs delivered with a crew of two or more.
goalnumberAmount to reach.
xp, moneynumberReward on completion.

Levels · data/levels.lua ​

required is the list of experience needed to go from each level to the next. Players start at level 1 and the maximum level is the number of entries plus one: 71 with the default file.

Outfits and props · data/outfits.lua, data/pieces.lua ​

data/outfits.lua holds the clothes of each outfit mode, for male and female: components as { component, drawable, texture } and props as { prop, drawable, texture }, where a drawable of -1 removes the prop. Adjust the numbers to the clothing of your server.

data/pieces.lua holds the models of the corals, trash, suitcases and boxes, the animation of each action and the layout of the boxes on deck. Change it only if you want other props.

Common changes ​

Limit the job to certain jobs ​

shared/config.lua
lua
job = { 'lifeguard', 'diver' },

Split the reward between the crew ​

shared/config.lua
lua
reward = { mode = 'split', bonusPerExtra = 0.25 },

Open suitcases without a knife ​

shared/config.lua
lua
suitcase = { weapon = 'WEAPON_UNARMED' },

Let players use the gear outside a job ​

shared/config.lua
lua
gear = {
    consumeMask = false,
    requireRun = false,
    confirmMs = 10000,
},

Add a wait between jobs ​

shared/config.lua
lua
run = {
    cooldownHours = 2,
    soloHalf = true,
    spawnFreeRadius = 10.0,
    exclusiveRegions = false,
},

© Cuxial