ScriptsAboutBlogToolsKnowledge BaseReviewsFAQBasketDocsSupport
QBCoreserver

Player.Functions.SetJob

QBCore server documentation with a FiveM Lua example.

Summary

Sets a player's job and grade. The standard way to hire/fire or change someone's job in QBCore.

Returns

boolean — whether it succeeded.

Parameters

jobstringThe job name (must exist in shared jobs).
gradenumberThe grade level.

Example

local Player = QBCore.Functions.GetPlayer(src)
Player.Functions.SetJob('police', 2)

Common pitfalls

  • The job must be defined in QBCore shared jobs or it won't apply cleanly.
  • Grade must exist for that job.
  • This is where multijob systems hook in — our Viper Multijob wraps this with validation.

Related functions

Related guides

Managing jobs on your server?

Viper Multi-Job lets players hold several jobs and switch between them with grade, salary and duty handled — QBCore, QBox and ESX, validated server-side.

See Viper Multi-Job →