Job Manager

For more information about this script, check out the youtube demo.

Installation

1

Download Script

After purchasing the script you will find it in FiveM's keymaster (keymaster.fivem.net).

2

Open ZIP and extract nxt_bossmenu

Inside the downloaded ZIP file, you'll find the purchased script along with nxt_bridge. Install nxt_bridge first and extract nxt_bossmenu into [nxt] aswell.

3

Start the Script

If you followed the documentation for nxt_bridge already this step is done. If you did not install it yet, check out nxt_bridge Installation.

Dependencys

Implementation

es_extended changes

Go to es_extended/server/functions.lua, at line 470 (version 1.12.3) you should see ESX.RefreshJobs(). If you cant find it at that line, search for it with ctrl+f.

In that function you need to add one line all the way on the bottom. In the end it should look like this (version 1.12.3):

function ESX.RefreshJobs()
    local Jobs = {}
    local jobs = MySQL.query.await("SELECT * FROM jobs")

    for _, v in ipairs(jobs) do
        Jobs[v.name] = v
        Jobs[v.name].grades = {}
    end

    local jobGrades = MySQL.query.await("SELECT * FROM job_grades")

    for _, v in ipairs(jobGrades) do
        if Jobs[v.job_name] then
            Jobs[v.job_name].grades[tostring(v.grade)] = v
        else
            print(('[^3WARNING^7] Ignoring job grades for ^5"%s"^0 due to missing job'):format(v.job_name))
        end
    end

    for _, v in pairs(Jobs) do
        if ESX.Table.SizeOf(v.grades) == 0 then
            Jobs[v.name] = nil
            print(('[^3WARNING^7] Ignoring job ^5"%s"^0 due to no job grades found'):format(v.name))
        end
    end

    if not Jobs then
        -- Fallback data, if no jobs exist
        ESX.Jobs["unemployed"] = { label = "Unemployed", grades = { ["0"] = { grade = 0, label = "Unemployed", salary = 200, skin_male = {}, skin_female = {} } } }
    else
        ESX.Jobs = Jobs
    end
    
    TriggerEvent("esx:refreshJobs", ESX.Jobs) -- changed part
end

If your function looks different, just add the line where it says changed part all the way at the bootom before the "end". Make sure to not replace this when you update your framework.

Last updated