Glitchworks

Home / Help centre

FiveM

Job to Discord roles

When a player's job changes in your FiveM server, Guard gives or takes their Discord roles to match. Works with QBCore, Qbox and ESX.

What it does

When a player's job changes in your FiveM server, Glitchworks Guard gives or takes their Discord roles to match. Hired into the police at grade 1? They get LSPD Officer in Discord. Promoted to grade 4? LSPD Officer comes off and LSPD Command goes on. Fired? The police roles come off.

Works with QBCore, Qbox and ESX out of the box, and any other framework with one line of code.

You'll need

  • Glitchworks Link installed and linked.
  • Glitchworks Guard's role above every role it should give (Server Settings > Roles: drag Glitchworks Guard up).
  • Your players must have Discord open when they play, so FiveM knows their Discord account.

Step 1: Find your job names

Job sync uses the job's name, not its label. For example:

Where to find job names
FrameworkWhere to lookExample names
QBCoreqb-core/shared/jobs.luapolice, ambulance, mechanic
Qboxqbx_core/shared/jobs.luapolice, ambulance
ESXyour database's jobs table (column name)police, ambulance

Grades are numbers: in QBCore and Qbox the grade level (0, 1, 2…), in ESX the grade column of job_grades.

Step 2: Add your rules

  1. Type /fivem setup > Job roles.
  2. Press Add a rule:
    • Job name: for example police.
    • Grades: 0-3 (grades 0 to 3), 4+ (4 and up), 2 (just 2), or blank for any grade.
  3. Press Submit, then pick the Discord role in the menu that appears.
  4. Repeat for each rule. Up to 25.

Or with a command:

/fivem jobs add job:police grades:0-3 role:@LSPD Officer
/fivem jobs add job:police grades:4+ role:@LSPD Command
/fivem jobs add job:police role:@LSPD
/fivem jobs add job:ambulance role:@EMS

The third rule gives @LSPD to every police grade, as well as the rank role.

See your rules with /fivem jobs list, and remove one with /fivem jobs remove.

Step 3: Choose how roles are taken off

Press the switch button to choose between:

  • Removes: only roles I gave Recommended. Guard only takes off a role it gave through job sync. If a staff member gave someone @LSPD by hand, it's left alone.
  • Removes: any mapped role. Job sync owns those roles completely: anyone with @LSPD who isn't police in game loses it at their next job change.

Step 4: Turn it on

Press Turn on.

Step 5: Test it

  1. Join your server with your own account (with Discord open).
  2. Give yourself a job, for example in QBCore or ESX: /setjob <your id> police 1.
  3. Within a few seconds, your Discord roles change.

Good to know

  • When it updates: whenever a job changes, when a player loads in, and when the resource starts (for everyone online).
  • Changes are queued and sent in batches, then applied one by one, so a busy server stays within Discord's limits. On a big server, give it up to a minute.
  • Nobody's job is stored. Guard only remembers which roles it gave, so it knows what it may take off.
  • Other frameworks: add one line where your framework changes a job:
    exports.glitchworks_link:SetJob(playerId, 'police', 2)
    and set Config.JobSync.Framework = 'none' in the resource's config.lua.

Troubleshooting

Job role sync problems and fixes
ProblemWhat to do
Nothing changesIs job sync on in /fivem setup > Job roles? Does the console say job sync on? Check the job name is the name (police), not the label (LSPD).
"Job sync can't give @Role: my role is below it"Move Glitchworks Guard above that role in Server Settings > Roles.
Roles change for some players onlyThose players didn't have Discord open when they joined, so FiveM couldn't see their Discord account.
A role was taken off that staff gave by handYou're on Removes: any mapped role. Switch to only roles I gave.
Console: job sync is on here but off in DiscordTurn it on in /fivem setup > Job roles, and add at least one rule.

Still stuck?

Open a ticket on our Discord and tell us what you've tried. Screenshots of any errors help us sort it faster.

Open a ticket on Discord

More help: Install Glitchworks Link · Duty and shifts · Whitelist and applications · Help centre