QBCore Frameworkqbcore.netCommunity docs
On this page

2 min read

QBCore job definitions and assignment

Define a job in qb-core/shared/jobs.lua, then assign it through a permission-checked server command. A job definition provides grades and pay; it does not install gameplay, uniforms, garages or a boss menu. This page is source-reviewed against the pinned upstream below, not a FiveM runtime test report.

Job definitions

Add this entry inside the existing jobs table in qb-core/shared/jobs.lua:

['docs_tow'] = {
    label = 'Documentation Tow Example',
    defaultDuty = false,
    offDutyPay = false,
    grades = {
        ['0'] = { name = 'Rookie', payment = 50 },
        ['1'] = { name = 'Driver', payment = 75 }
    }
},

Grade keys are strings. Upstream uses name and payment, not label and salary, for the grade. The pay amounts are example economy values. Restart the affected server resources in staging to load changed definitions; a console refresh only rescans resource manifests.

Assigning a job

Use the built-in command from an account configured with the required administrative permission:

/setjob 7 docs_tow 0

7 is a connected player's server ID; substitute the actual target ID. Do not expose an unrestricted CreateCallback or RegisterNetEvent that changes a player's job. A client can invoke a callback directly, so a menu or hidden button provides no authorization.

For custom administrative assignment, follow the server-side permission and grade validation in set job safely. Configure access using admin permissions.

Going on duty

If your job resource already provides a duty interaction, use that interface. For a development command, place this in a client script:

RegisterCommand('docs_duty', function()
    TriggerServerEvent('QBCore:ToggleDuty')
end, false)

This requests the core duty toggle; it does not grant a job. Sensitive job actions still need their own server-side job, grade, duty and location checks. See server event security.

Verification

  • Run /job on the assigned character to inspect the job, grade and duty state at the pinned revision.
  • Run /docs_duty, then /job again and confirm that the duty value changes.
  • Verify job updates reach your actual job resource and test logout/reconnect persistence in staging.
  • Confirm an account without assignment permission cannot use /setjob.

The shared job grade has payment; the resolved Player job exposes pay under job.grade.payment at this revision. Don't assume a different fork or older core has the same Player data shape.

See also

Next steps

Explore permissions and core concepts.

Found an issue in this guide?

Send the page URL, the affected example, and a source or reproduction to the site maintainer. For a server or resource problem, use the support guide.

On this page

Leonida RP server website built with RPWebsite
RPWebsite

Advertisement · RPWebsite

Want a website for your server?

Launch a site with live player status, rules, and a join button in minutes.

Build your website