Skip to content
FIVECRATE
Frameworks intermediate

How to Add Jobs to a FiveM Server (Qbox, QBCore, ESX)

How to add jobs to a FiveM server on Qbox, QBCore and ESX Legacy, with jobs.lua and gangs.lua blocks, the ESX job tables, /setjob and the common errors.

Police officer, paramedic and mechanic talking outside a city garage beside their service vehicles
Author: FiveCrate
Published:
Updated:
Read time: 16 min
Applies to
FiveM Legacy and FiveM for GTAV Enhanced; qbx_core v1.24.1 (October 30, 2026), ESX Legacy 1.16.4 (October 18, 2026), qb-core repository as of August 24, 2026 (legacy reference)
Last verified

Direct Answer

To add jobs to a FiveM server, add the job to your framework’s job list, load it, then give it to a player with /setjob. On Qbox, add a block to qbx_core/shared/jobs.lua with a lower-case name, a label and numbered grades written without quotes ([0]), then restart the server. On QBCore, the file is qb-core/shared/jobs.lua and grade keys are strings (['0']). On ESX Legacy, insert one row in the jobs table and one row per grade in job_grades, then run refreshjobs. Gangs sit next to jobs, in shared/gangs.lua, on Qbox and QBCore.

Where jobs are defined on Qbox, QBCore and ESX

A job is a record the framework keeps: a name, a display label, grades (ranks) and the pay of each grade. Scripts such as a police or mechanic job read that record to decide who may use their features. Adding a job to the list does not add any gameplay by itself: duty points, vehicles and menus come from a job script. A server without a framework has no job list at all. The txAdmin recipe “FiveM Basic Server” is described as “A minimal server, without framework”, so racing, PvP or freeroam servers built on it only get jobs if they install a framework or a standalone job script that brings its own system.

QboxQBCore (legacy reference)ESX Legacy
Jobsqbx_core/shared/jobs.luaqb-core/shared/jobs.luajobs and job_grades tables
Gangsqbx_core/shared/gangs.luaqb-core/shared/gangs.luaNo gang list in the core
Grade keys[0], [1] (numbers)['0'], ['1'] (strings)grade column (number)
Pay fieldpaymentpaymentsalary
Load a changeRestart the serverRestart the serverrefreshjobs or restart
Give a job/setjob id job [grade]/setjob id job grade/setjob id job grade

QBCore is shown as a reference only. Its documentation now says “QBCore has withdrawn from other platforms” and that its pages “remain here as a reference”. The QBCore, Qbox and ESX comparison explains what that means for a server today.

Qbox jobs: add a job to qbx_core/shared/jobs.lua

The Qbox job fields

The Qbox documentation defines a job with these fields, and the grades table uses integer keys (grades: table<integer, JobGradeData>):

FieldTypeWhat it does
labelstringName players see
typestring, optionalGroup of jobs; the default file uses leo for police and ems for the ambulance job
defaultDutybooleanWhether the player starts on duty
offDutyPaybooleanWhether the player is paid while off duty
grades[n].namestringRank name
grades[n].paymentnumberPay per paycheck
grades[n].isbossboolean, optionalMarks a boss rank
grades[n].bankAuthboolean, optionalLets that rank use the job’s bank account

Steps

  1. Open the file. Stop the server and open resources/[qbx]/qbx_core/shared/jobs.lua (the folder layout of the Qbox recipe). The file starts with the comment “Job names must be lower case (top level table key)” and then return {.
  2. Copy an existing block. The mechanic job of the default file is a complete five-grade example. It is shown here inside return { } as in the file: copy only the ['mechanic'] = { ... }, part, paste it before the last closing brace, and change the key, the label and the grades:
return {
    ['mechanic'] = {
        label = 'Mechanic',
        type = 'mechanic',
        defaultDuty = true,
        offDutyPay = false,
        grades = {
            [0] = {
                name = 'Recruit',
                payment = 50
            },
            [1] = {
                name = 'Novice',
                payment = 75
            },
            [2] = {
                name = 'Experienced',
                payment = 100
            },
            [3] = {
                name = 'Advanced',
                payment = 125
            },
            [4] = {
                name = 'Manager',
                isboss = true,
                bankAuth = true,
                payment = 150
            },
        },
    },
}
  1. Keep the name in lower case. On start, qbx_core prints jobs.lua contains a job name with capital letters: <name> for any key that is not lower case.
  2. Number grades from 0, without quotes. The Qbox migration guide states: “Grade numbers are written without quotes. [‘0’] becomes [0]. With quotes, Qbox can’t find the grade.” Commands that take no grade use grade 0. The player_groups table stores the grade as TINYINT(3) UNSIGNED, which in MariaDB holds 0 to 255.
  3. Give the boss rank bankAuth = true. Per the Qbox docs, “Boss grades need bankAuth = true to use the job’s bank account”, because Renewed-Banking “checks this instead of isboss”.
  4. Keep unemployed. It is the job of every character without one. If it is missing, characters cannot load and qbx_core stops with “Unemployed job not found. Does it exist in shared/jobs.lua?”
  5. Restart the server. qbx_core loads the file when it starts (local jobs = require 'shared.jobs' in server/groups.lua), so a full restart is the simple way to load an edit.

A new police job needs one more line outside qbx_core. The Qbox docs say: “if you have police jobs besides police, bcso and sasp, add their names to inventory:police in ox.cfg”, so the job can use the police features of ox_inventory.

A missing comma or brace shows up as a Lua error naming the file and line. The Qbox docs use this example: SCRIPT ERROR: @qbx_core/shared/jobs.lua:57: '}' expected (to close '{' at line 3) near 'police', and advise to “go to that line and look just above it”.

Before you update qbx_core, copy your edited files out of the resource. The Qbox update steps list “the config folder, and shared/jobs.lua, gangs.lua, vehicles.lua and main.lua”, because the resource folder is deleted and unpacked again.

Add a job from a script with CreateJob

Scripts can add jobs at runtime with exports.qbx_core:CreateJob(jobName, job) or CreateJobs. The Qbox export documentation says: “This is a runtime-only change. This won’t persist across restarts and won’t modify files.” The v1.24.1 source disagrees in one point: it adds an optional third argument, commitToFile, which rewrites the whole shared/jobs.lua from the jobs loaded in memory with SaveResourceFile. The rewritten file writes label, defaultDuty, offDutyPay and the grades of every job, but no type line for any of them, so keep a copy of your file before you pass true.

Multiple jobs per character: qbx:max_jobs_per_player

qbx_core has a built-in multijob. The Qbox docs say the qbx: settings in server.cfg include “qbx:max_jobs_per_player for multiple jobs per character”. Each job a character holds is a row in player_groups, the table that “the boss menu and multiple jobs use”.

Convar (server.cfg)DefaultWhat it does
set qbx:max_jobs_per_player 11Maximum jobs per character
set qbx:max_gangs_per_player 11Maximum gangs per character
set qbx:setjob_replaces "true"true/setjob replaces the current job instead of adding one
set qbx:setgang_replaces "true"trueSame for /setgang
set qbx:cleanPlayerGroups "true"see belowDeletes jobs and grades that are no longer in your files from player_groups on start

To let a character hold three jobs, set set qbx:max_jobs_per_player 3 and restart. Then /addjob 23 mechanic adds a job (grade 0 unless you add a grade after the name), /changejob 23 mechanic switches the active job and /removejob 23 mechanic takes one away. The player ID always comes first.

Read qbx:cleanPlayerGroups before you rename or delete a job. When it is on, qbx_core deletes every player_groups row whose job or grade is no longer in your files, and logs Remove invalid job ... from player_groups table. The Qbox recipe server.cfg sets it to "true". The convar page shows "true" as the default, while the v1.24.1 source falls back to 'false' when the line is absent. Before you rename a job or remove a grade, back up the database or set the line to "false" for that restart.

QBCore jobs.lua: add a job (legacy reference)

On QBCore, jobs are in qb-core/shared/jobs.lua. The QBCore docs list the same job fields as Qbox (label, type, defaultDuty, offDutyPay, grades), with name, payment and the optional isboss per grade. They list no bankAuth field.

  1. Open qb-core/shared/jobs.lua. In the current repository the file starts with QBCore.Shared.ForceJobDefaultDutyAtLogin = true and QBCore.Shared.Jobs = {. Older copies start with QBShared.Jobs = {, as the Qbox migration guide shows. Both hold the same table.
  2. Add a block inside the table, with grade keys in quotes. This is the default mechanic job, shown inside the table line it belongs to; copy only the mechanic = { ... }, part:
QBCore.Shared.Jobs = {
	mechanic = {
		label = 'LS Customs',
		type = 'mechanic',
		defaultDuty = true,
		offDutyPay = false,
		grades = {
			['0'] = { name = 'Recruit', payment = 50 },
			['1'] = { name = 'Novice', payment = 75 },
			['2'] = { name = 'Experienced', payment = 100 },
			['3'] = { name = 'Advanced', payment = 125 },
			['4'] = { name = 'Manager', isboss = true, payment = 150 },
		},
	},
}
  1. Keep the key in lower case. Player:SetJob runs job = job:lower() before it looks the job up, so a key with capitals can never be assigned.
  2. Restart the server. shared/jobs.lua is one of the shared_scripts in qb-core’s fxmanifest.lua, so it is read when qb-core starts.

qb-core also has a runtime export, exports['qb-core']:AddJob(jobName, job), which refuses an existing name with job_exists and only changes the table of the running server.

ForceJobDefaultDutyAtLogin decides the duty state at login. The comment in the file reads: “true: Force duty state to jobdefaultDuty | false: set duty state from database last saved”.

ESX jobs: add a job to the jobs and job_grades tables

ESX Legacy keeps jobs in the database, not in a Lua file. es_extended.sql creates two tables:

TableColumns
jobsname VARCHAR(50), label VARCHAR(50)
job_gradesid, job_name, grade, name, label, salary, skin_male, skin_female

On start, es_extended also adds a type column to jobs (VARCHAR(50) NOT NULL DEFAULT 'civ') if it is missing. Each character’s current job is stored in users.job and users.job_grade, and users.job is VARCHAR(20), so keep ESX job names to 20 characters or fewer.

  1. Open the database. Use HeidiSQL or the tool you set up in the MariaDB database guide, and select your ESX database.
  2. Insert the job and its grades. This follows the esx_taxijob SQL, with empty outfits ('{}', as the unemployed grade in es_extended.sql uses) because skin_male and skin_female cannot be NULL:
INSERT INTO `jobs` (name, label) VALUES
	('taxi', 'Taxi')
;

INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
	('taxi',0,'recrue','Recrue',12,'{}','{}'),
	('taxi',4,'boss','Patron',0,'{}','{}')
;
  1. Name the top grade boss if you use esx_society. Its Config.BossGrades defaults to { ['boss'] = true }, so the boss menu goes by the grade’s name, not by a flag.
  2. Load the job. Run refreshjobs in the server console, or use /refreshjobs in game as owner or admin. The ESX docs describe it as: “Refreshes the all known jobs.” A restart works too.

A job with a shared company account also needs rows for that account. The esx_taxijob SQL adds society_taxi to addon_account, datastore and addon_inventory, and the script registers it with esx_society:registerSociety. The script installation guide covers running a resource’s SQL file.

A script can also create a job with ESX.CreateJob, which “creates a new job and inserts it into the database”. The ESX docs example:

ESX.CreateJob("baker", "Baker", {
 {grade = 0, name = "apprentice", label = "Apprentice", salary = 320},
 {grade = 1, name = "employee", label = "Employee", salary = 470},
 {grade = 2, name = "senior", label = "Senior Baker", salary = 610},
 {grade = 3, name = "owner", label = "Owner", salary = 910},
})

In the 1.16.4 source, ESX.CreateJob takes a fourth argument, the job type, and uses "civ" when none is given.

Paychecks and duty

QboxQBCoreESX Legacy
Interval settingpaycheckTimeout = 10 (minutes, config/server.lua)PayCheckTimeOut = 10 (minutes, config.lua)Config.PaycheckInterval = 7 * 60000 (milliseconds)
Off dutyPaid only if offDutyPay is truePaid only if offDutyPay is trueConfig.OffDutyPaycheckMultiplier = 0.5
Pay from the company accountpaycheckSociety = falsePayCheckSociety = falseConfig.EnableSocietyPayouts = false

How to give a player a job: /setjob on Qbox, QBCore and ESX

Find the player’s server ID first (Qbox has /id), then run the command in game. Each player checks their own job with /job. On ESX, setjob and refreshjobs also run from the server console (for example setjob 23 taxi 4).

FrameworkCommandWho may run itNotes
Qbox/setjob 23 mechanic 2group.adminGrade is optional (0). me works as the ID (/setjob me police 4). Admins must type /optin once first
QBCore/setjob 23 mechanic 2adminA grade that does not exist gives the rank “No Grades”
ESX Legacy/setjob 23 taxi 4owner, adminThe grade is required

On Qbox, /setjob replaces the current job while qbx:setjob_replaces is true. The Qbox command page gives /setjob 23 police 3 as “Make player 23 a Police Sergeant (grade 3)”, but in the default jobs.lua grade 3 of police is Lieutenant and Sergeant is grade 2. Read the grade numbers from your own file.

How to get group.admin, /optin and the ESX admin group is covered in the admin permissions guide for Qbox, QBCore and ESX.

How to add gangs on Qbox and QBCore

Gangs work like jobs without pay. They serve gang servers and the criminal side of roleplay servers.

  1. Open the gangs file: qbx_core/shared/gangs.lua on Qbox, qb-core/shared/gangs.lua on QBCore.
  2. Copy a gang block. Gangs have a label and grades with a name and optional isboss (plus bankAuth on Qbox). On QBCore the grade keys are quoted, as in its jobs file: ['3'] = { name = 'Boss', isboss = true },. On Qbox:
return {
    ['ballas'] = {
        label = 'Ballas',
        grades = {
            [0] = {
                name = 'Recruit'
            },
            [1] = {
                name = 'Enforcer'
            },
            [2] = {
                name = 'Shot Caller'
            },
            [3] = {
                name = 'Boss',
                isboss = true,
                bankAuth = true
            },
        },
    },
}
  1. Keep the none gang. Characters without a gang use it; qbx_core stops with “none gang not found. Does it exist in shared/gangs.lua?” if it is gone.
  2. Restart, then assign with /setgang 23 ballas 2. Check with /gang.

On Qbox, qbx:max_gangs_per_player allows more than one gang per character. ESX Legacy’s core has no gang list: its users table holds one job and one job_grade per character, so gangs on ESX come from a separate script.

FiveM Legacy and FiveM for GTAV Enhanced

Jobs, grades and the commands above are part of the framework resources, not of the game client. txAdmin’s recipe list for Enhanced servers (indexv5.json) offers the same ESX Legacy and Qbox recipes as the Legacy list, so this guide applies to both.

Troubleshooting

“jobs.lua contains a job name with capital letters”

A top-level key in qbx_core/shared/jobs.lua has capitals. Change it to lower case and restart. The same check exists for gangs.lua.

Qbox: “cannot set job. Job … does not exist”

The name in /setjob is not in jobs.lua, or the server has not restarted since you added it. qbx_core prints cannot set job. Job %s does not have grade %s when only the grade is missing.

Qbox: “player already has maximum amount of jobs allowed”

/addjob refuses a job when the character already holds qbx:max_jobs_per_player jobs. Raise the convar or remove a job with /removejob.

Qbox: “You are not opted in for admin duty. (/optin to toggle)”

Type /optin in chat once. The admin permissions guide explains the opt-in and how to turn it off.

Qbox: “Invalid grade … found in player_groups table”

A character holds a grade that is missing from your file, often because grade keys have quotes or were renumbered. Put the grade back in the file before the next start: with qbx:cleanPlayerGroups on, qbx_core deletes such rows when it starts, and the character loses that rank. Migrating from QBCore to Qbox covers converting a whole QBCore jobs file.

ESX: “the job, grade or both are invalid”

/setjob checks that the job and grade exist in the loaded list. Run refreshjobs after inserting rows and use a grade number that is in job_grades.

ESX: “Invalid Argument Count (passed 2, wanted 3)”

ESX’s /setjob needs all three arguments. Add the grade: /setjob 23 taxi 0.

ESX: “Ignoring job … due to no job grades found”

The job is in jobs but no row in job_grades has its name in job_name. Add at least grade 0. es_extended also prints “Ignoring job grades for … due to missing job” in the reverse case.

ESX: a player’s job went back to unemployed after a restart

At login, es_extended prints Ignoring invalid job for ... and sets unemployed grade 0 when the stored job or grade no longer exists.

QBCore: the player’s rank shows “No Grades”

Player.Functions.SetJob accepted the job but found no grade with that key, so it set level 0 and payment 30. Use a grade that exists in jobs.lua.

Next Steps

Official documentation and repository references