Skip to main content

DoesJobExist

ESX.DoesJobExist(job, grade)

This function returns whether or not the job and grade specified is valid.

Arguments

ArgumentData TypeOptionalDefault ValueExplanation
Job NamestringNo-The name of the job.
Job GradenumberNo-The grade of the job.

Example

local xPlayer = ESX.GetPlayerFromId(source)
local Job = "police"
local Grade = 4 -- highest police grade

if ESX.DoesJobExist(Job, Grade) then -- make sure the Job and Grade are both defined in the database
xPlayer.setJob(Job, Grade)
end