Skip to content

Cuxial Jobs

The shared library behind the Cuxial team jobs: crews, runs, payouts and progress.

Cuxial Jobs is the common library used by the Cuxial team jobs: Cuxial Diving, Cuxial Electrician, Cuxial Gardener and Cuxial Supply. It gives all of them the same crews, runs, payouts and player progress, so every job behaves the same way and is configured the same way.

It is included in the package of each of those jobs. You install it once, and all the jobs you own share it.

It is a library: it has no commands, interface or configuration file of its own. Each job loads it and uses it with its own settings.

What it adds to each job ​

PartWhat the job gets
Job pointAn NPC with a blip and a target option that opens the job menu.
CrewsInvitations to nearby players, a maximum crew size, a saved seat for members who disconnect during a run, and a reward split set by the crew owner.
RunsRegions to work in, optionally one crew per region at a time, an optional wait between runs, and the final delivery.
PayoutMoney paid to the account you choose, several ways to share it among the crew, and optional item rewards.
ProgressLevel and experience per job, daily tasks, run history and a leaderboard.
Work outfitOptional work clothes for the run, with the player's own outfit restored afterwards.
GuidanceFirst-time tips and an end-of-run summary.
Staff toolsCommands to list and close crews, an audit log and Discord logs through a webhook.

Progress is kept per job: a player's level as a diver is separate from their level as an electrician.

Installation ​

Check the dependencies ​

Cuxial Jobs needs nothing by itself. The jobs that use it need:

  • OneSync
  • ox_lib
  • oxmysql
  • cuxial_bridge
  • sleepless_interact

Cuxial Diving, Cuxial Gardener and Cuxial Supply also need their assets resource, cuxial_diving_assets, cuxial_gardener_assets and cuxial_supermarket_assets, delivered with each script.

Copy the resource ​

Place the cuxial_jobs folder in your resources directory. One copy serves every job. If two packages bring different versions, keep the newest.

Keep the folder name cuxial_jobs. Every job loads it by that exact name and will fail to start if you rename it.

Start it before the jobs ​

Add it below Cuxial Bridge and above every job.

server.cfg
cfg
ensure ox_lib
ensure oxmysql
# your framework and inventory here
ensure sleepless_interact

ensure cuxial_bridge
ensure cuxial_jobs

ensure cuxial_diving_assets
ensure cuxial_gardener_assets

ensure cuxial_diving
ensure cuxial_electrician
ensure cuxial_gardener

Only list the jobs you own.

Check the server console ​

On start, the library prints its version:

[cuxial_jobs] 1.0.0 listo (librería de trabajos por equipos)

No SQL to run. The first job that starts creates the shared tables.

Configuration ​

Cuxial Jobs has no configuration file and no convars of its own. Everything it does is set in each job, in that job's shared/config.lua and data folder, so two jobs can use different values.

These blocks appear in every job and are read by the library:

Block in the job's shared/config.luaWhat it controls
debugDebug messages in the console.
uiAccent colour of the job menu and money format.
logsName of the convar that holds the Discord webhook.
adminDays the audit log is kept.
accountAccount that receives the money.
jobWho can do the job: 'all', one framework job or a list of them.
npcPosition, model, distances and blip of the job NPC.
crewCrew size, invitation distance and time, reconnection time, reward split.
runWait between runs and whether a region allows one crew at a time.
rewardHow the payout is shared and which items are given.
outfitWork outfit mode.
leaderboard, history, profileSize of the leaderboard and the history, and how often progress is saved.
commandsNames of the job commands and who can use them.
keysDefault keys.
tips, finishSeconds the tips and the final summary stay on screen.

Levels, daily tasks, regions and outfits are in the job's data folder: levels.lua, daily.lua, regions.lua and outfits.lua.

The page of each job explains its own values and the options that only that job has.

Convars per job ​

Each job reads two optional convars. Their names start with the job's folder name, shown here as <resource>.

ConvarUsed forSet with
<resource>_debug1 turns on debug messages without editing the config.setr
<resource>_webhookDiscord webhook for that job's logs. Empty means no Discord logs.set
server.cfg
cfg
setr cuxial_diving_debug "0"
set cuxial_diving_webhook "https://discord.com/api/webhooks/..."

The webhook goes in server.cfg, never in shared/config.lua. It is read once when the job starts, so place the line above the job's ensure. The name of the webhook convar can be changed in the job's logs.convar.

Commands per job ​

Each job registers its own commands. Their names are set in the job's commands block, and setting a name to false removes that command.

EntryWhoWhat it does
resetEveryoneResets the player's current run.
leaveEveryoneLeaves the crew. The owner cannot leave during a run.
listStaffLists the open crews with their size, region and phase.
closeStaffCloses a crew by its number.
fastStaffTesting shortcut. Works only with debug enabled.

The staff entries are limited by their restricted value, 'group.admin' by default.

Database ​

The jobs share four tables, created automatically when the first job starts:

TableWhat it stores
cuxial_jobs_playersLevel, experience and daily tasks of each character, per job.
cuxial_jobs_runsFinished runs.
cuxial_jobs_run_membersWho took part in each run and what they earned.
cuxial_jobs_auditAudit log of staff actions.

Removing a job does not delete its rows.

Updates ​

A job and the library are made to work together. Each job states which library version it expects, and the library warns in the server console when they do not match:

[cuxial_jobs] cuxial_diving pide la librería 2.0 y esta es la 1.0.0

When you update a job, replace the cuxial_jobs folder with the one from the same package and restart the server. See Updating a script.

Common problems ​

A job fails to start with an error mentioning cuxial_jobs

Cause. The library is missing, was renamed, or starts after the job.

Fix. Confirm the folder is named cuxial_jobs and that ensure cuxial_jobs appears before the job.

The console says a job asks for another library version

Cause. The job and cuxial_jobs come from different releases.

Fix. Replace cuxial_jobs with the copy that came in the newest package you have, and update the other jobs to the same release.

The console warns about items that do not exist in the inventory

The warning reads items que no existen en el inventario: followed by the item names.

Cause. The job gives items as a reward and one of them is not registered in your inventory.

Fix. Add the items to your inventory, or remove them from the job's reward.items.

Progress is not saved

Cause. The shared tables could not be created. The server console shows a failed query from the job.

Fix. Check the oxmysql connection and that the database user can create tables, then restart the job.

Logs do not reach Discord

Cause. The webhook convar is empty, has a different name from the job's logs.convar, or is set after the job starts.

Fix. Add the convar to server.cfg above the job's ensure line and restart the job.

© Cuxial