How To Do

Here you can find out how to do some things.

How to enable SideJob - Other Job option

With this feature, you can enable people to use this system as a 2nd or 3rd profession by not using setJob functions by core.

Config.SideJob = true -- If you want to use the side job system, you can activate it here. If you want to use the main job system, you can disable it.

Send Trigger when a job is finished

When a profession is finished, you can send a Trigger/Export to another script using the function below with the finished profession information.

Config.JobSuccess = function(job, reward, index, currTime, usedExtraTime)
    print('Job Success', job, reward, index, currTime, usedExtraTime)
    -- Here your extra codes
end

Making a Level query when choosing a job

If you have a Level script on your server, you can make a query by finding the codes and file below. Thus, people will no longer be able to take that job without having the required level.

For this go to the following file path. wais-jobpack/client/editable.lua

function selectJob(job)
    -- You can put your own queries or content here. 
    -- If you want to use the level system, you can add the user level query here.
    
    -- ENTER YOUR LEVEL QUERY HERE
    -- ENTER YOUR LEVEL QUERY HERE
    
    local playerLevel = exports["my-level-script"]:getLevel()
    local jobLevels = {
            ["pizza_delivery"] = 1
            ["news_delivery"] = 1,
            ["mobile_hotdog"] = 1,
            ["forklifter"] = 4,
            ["gardener"] = 4,
            ["trucker"] = 5,
            ["roadhelper"] = 6,
            ["bus_driver"] = 6,
            ["fire_department"] = 8,
            ["hunter"] = 8,
            ["detectorist"] = 5,
            ["project_car"] = 10,
            ["diver"] = 5,
            
            --["job-name"] = Required level ---@number
            -- Add here the level required for the professions in the Config to be used as above
        }
    
    if jobLevels[job] ~= nil and jobLevels[job] < playerLevel then
        -- The player does not have enough Level to perform this job.
        return Config.Notification(Lang('job'), "Your level is not enough", "error", 5000)
    end
    
    --If the player's Level is sufficient for the profession he will take, the following codes will work
    
    if Config.SideJob then
        TriggerEvent('wais:set:sideJob', job)
    else
        TriggerServerEvent('wais:setJob', job)
    end
    SetNewWaypoint(Config.Jobs[job].menu.job_menu.x, Config.Jobs[job].menu.job_menu.y)
end

Last updated