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
| Part | What the job gets |
|---|---|
| Job point | An NPC with a blip and a target option that opens the job menu. |
| Crews | Invitations 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. |
| Runs | Regions to work in, optionally one crew per region at a time, an optional wait between runs, and the final delivery. |
| Payout | Money paid to the account you choose, several ways to share it among the crew, and optional item rewards. |
| Progress | Level and experience per job, daily tasks, run history and a leaderboard. |
| Work outfit | Optional work clothes for the run, with the player's own outfit restored afterwards. |
| Guidance | First-time tips and an end-of-run summary. |
| Staff tools | Commands 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_liboxmysqlcuxial_bridgesleepless_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.
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_gardenerOnly 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.lua | What it controls |
|---|---|
debug | Debug messages in the console. |
ui | Accent colour of the job menu and money format. |
logs | Name of the convar that holds the Discord webhook. |
admin | Days the audit log is kept. |
account | Account that receives the money. |
job | Who can do the job: 'all', one framework job or a list of them. |
npc | Position, model, distances and blip of the job NPC. |
crew | Crew size, invitation distance and time, reconnection time, reward split. |
run | Wait between runs and whether a region allows one crew at a time. |
reward | How the payout is shared and which items are given. |
outfit | Work outfit mode. |
leaderboard, history, profile | Size of the leaderboard and the history, and how often progress is saved. |
commands | Names of the job commands and who can use them. |
keys | Default keys. |
tips, finish | Seconds 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>.
| Convar | Used for | Set with |
|---|---|---|
<resource>_debug | 1 turns on debug messages without editing the config. | setr |
<resource>_webhook | Discord webhook for that job's logs. Empty means no Discord logs. | set |
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.
| Entry | Who | What it does |
|---|---|---|
reset | Everyone | Resets the player's current run. |
leave | Everyone | Leaves the crew. The owner cannot leave during a run. |
list | Staff | Lists the open crews with their size, region and phase. |
close | Staff | Closes a crew by its number. |
fast | Staff | Testing 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:
| Table | What it stores |
|---|---|
cuxial_jobs_players | Level, experience and daily tasks of each character, per job. |
cuxial_jobs_runs | Finished runs. |
cuxial_jobs_run_members | Who took part in each run and what they earned. |
cuxial_jobs_audit | Audit 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.0When 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.
