๐Ÿ“Configuration

Client config

Config = {}

Config.locales = 'en' -- en | pl

Config.getVehicleLabel = function(hash)
    local veh = GetDisplayNameFromVehicleModel(hash)
    local label = GetLabelText(veh) ~= 'NULL' and GetLabelText(veh) or nil
    return label or veh
end

RegisterCommand('bossmenu', function()
    openBossmenu()
end)

Config.hireAlert = function(name, job)
    local alert = lib.alertDialog({
        header = 'Attention!',
        content = name .. ' invited you to work for ' .. job .. '.  \nDo you accept the invitation?',
        centered = true,
        cancel = true
    })
    return alert == 'confirm' and true or false
end

Config.dutyOptions = function(job)
    {
        {
            icon = 'fas fa-business-time',
            label = 'Go on duty',
            distance = 2.0,
            groups = {
                [job.onduty] = 0,
                [job.offduty] = 0
            },
            onSelect = function(data)
                TriggerServerEvent('pp-bossmenu:setDuty', true, job)
            end
        },
        {
            icon = 'fas fa-business-time',
            label = 'Go off duty',
            distance = 2.0,
            groups = {
                [job.onduty] = 0,
                [job.offduty] = 0
            },
            onSelect = function(data)
                TriggerServerEvent('pp-bossmenu:setDuty', false, job)
            end
        }
    }
end

Config.dutyProgress = function(onduty)
    local progress = lib.progressBar({
        duration = 5000,
        label = onduty and 'Entering duty' or 'Leaving duty',
        useWhileDead = false,
        canCancel = true,
        disable = {
            car = true,
            move = true
        },
    })
    return progress
end

Server config

Last updated

Was this helpful?