Configuration

Available configuration options to customize the script.

config.lua
Config = {Locales = {}}

Config.Framework = 'auto' -- 'auto', 'qb' (use qb for qbox), 'esx', 'custom' -- setup custom in bridges/custom/custom_bridge.lua

--[[
    Only required if Config.Framework = 'esx'
    Options:
        'new' -- v1.8.5-latest
        'old' -- v1 - v.1.8.5
]]
Config.ESXVersion = 'new'

Config.Phone = 'auto' -- options: 'auto', 'qb-phone', 'quasar', 'gksphone', 'lbphone', 'yflip', 'okokPhone', 'jpr-phonesystem', 'roadphone', 'custom' -- for mail -- setup custom in config/sv_customizable_functions.lua

Config.Interface = {
    Menu = 'ox', -- options 'qb', 'ox', 'custom' -- editable in cl_customizable_functions.lua
    Input = 'ox', -- options 'qb', 'ox', 'custom' -- editable in cl_customizable_functions.lua
    Notifications = 'ox', -- options 'esx', 'qb', 'ox', 'custom' -- editable in cl_customizable_functions.lua
    TextUI = 'ox' -- options 'esx', 'qb', 'ox', 'custom' -- editable in cl_customizable_functions.lua
}

Config.Zones = 'ox' -- options 'PolyZone', 'ox', 'custom' -- editable in cl_customizable_functions.lua

Config.Target = false  -- true/false

Config.DeputyVoting = { -- additional setting for deputy voting to allow or prohibit president and chairman from vote on deputy votes
    president = true, -- true if you want to allow the president to vote in deputies votings, false if you don't want to.
    chairman = true -- true if you want to allow the chairman to vote in deputies votings, false if you don't want to.
}

Config.Translation = 'en' -- check in 'locales' folder

Config.TaxSystem = 1 -- option 1 = tax not included in price, option 2 = tax included in price || example for 20% tax: (1 = player will pay 12$ for 10$ product) (2 = player will pay 10$ for 10$ product but shop recieves 8$)

Config.PartyManagement = { -- commands for the politcal parties
    manageParty = "managepp",
    checkMyParty = "pp",
    leaveParty = "leavepp"
}

Config.LawsCommand = { -- command and keybind for opening the laws menu. Keybind can be changed in-game from the FiveM options menu!
    commandName = 'laws',
    keyBind = 'B',
}

Config.Blips = {
    townhall = {
        show = true,
        sprite = 525, -- https://docs.fivem.net/docs/game-references/blips/
        color = 0, -- https://docs.fivem.net/docs/game-references/blips/
        size = 0.8, -- has to be in decimals
        label = 'Town Hall',
        coords = vector3(-556.03, -193.58, 38.23)
    }
}

Config.Icons = { -- check compatible icons depending on what interface (menu/input) you use - default https://fontawesome.com (compatible with ox/qb)
    ['Manage Members'] = 'fas fa-users',
    ['Create Election'] = 'fas fa-users',
    ['End Election'] = 'fas fa-vote-yea',
    ['Ban From Elections'] = 'fas fa-ban',
    ['Unban From Elections'] = 'fas fa-check-square',
    ['Clear Player Votes'] = 'fas fa-eraser',
    ['Announcement'] = 'fas fa-paper-plane',
    ['Hire Deputy'] = 'fas fa-briefcase',
    ['Fire Deputy'] = 'fas fa-sign-out-alt',
    ['Money Management'] = 'fas fa-university',
    ['Money Deposit'] = 'fas fa-donate',
    ['Money Withdraw'] = 'fas fa-money-bill-wave',
    ['Election Options'] = 'fas fa-print',
    ['Political Parties Options'] = 'fas fa-user-slash',
    ['Other Options'] = 'fas fa-paper-plane',
    ['President Menu'] = 'fas fa-flag',
    ['Conference Menu'] = 'fas fa-book-open',
    ['Conference Menu Title'] = 'fas fa-bookmark',
    ['Party Application'] = 'fas fa-book-open',
    ['Party Application Title'] = 'fas fa-bookmark',
    ['Party Applications List'] = 'fas fa-print',
    ['Voting Menu'] = 'fas fa-print',
    ['Party Rename'] = 'fas fa-pen',
    ['Party Disband'] = 'fas fa-trash',
    ['Manage Political Parties'] = 'fas fa-list',
    ['Tax Management'] = 'fas fa-money-bill',
    ['Income Tax'] = 'fas fa-percent',
    ['VAT Tax'] = 'fas fa-percent'
}

Config.Job = {
    jobname = 'politician',
    joblabel = 'Politician',
    grades = { --- do not change keys (president, chairman, deputy), only change numbers of grades (if wanted), and keep the order of numbers from lower perms to higher perms
        president = 2,
        chairman = 1,
        deputy = 0
    }
}

Config.PresidentMenu = {
    targetCoords = vector3(-528.66, -188.68, 42.95),
    pedHeading = 121.93,
}

Config.ConferenceRoom = {
    targetCoords = vector3(-534.69, -178.28, 43.80), -- location of the conference menu
    roomCoords = vector3(-537.2, -179.84, 44.26), -- put the center of the room
    radius = 15, -- the radius from the room coords where deputies can vote ( we don't want someone who is not in the hall to vote so that's why we are using this )
}

Config.Application = {
    ped = {
        pedModel = 'cs_bankman',
        pedCoords = vector3(-542.43, -197.23, 38.24),
        pedHeading = 77.25,
    },
}

Config.VotingLocation = {
    {
        points = { -- acts as points for polyzone/qb-target/ox_target/ox_lib
            vector3(-541.32, -183.47, 37.23),
            vector3(-543.91, -179.28, 37.23),
            vector3(-542.76, -178.18, 37.23),
            vector3(-540.39, -182.63, 37.23)
        },
        label = 'Vote'
    },
    {
        points = { -- acts as points for polyzone/qb-target/ox_target/ox_lib
            vector3(-535.76, -174.53, 37.23),
            vector3(-533.43, -178.4, 37.23),
            vector3(-534.19, -173.66, 37.23),
            vector3(-531.93, -177.52, 37.23)
        },
        label = 'Vote',
        coords = {
            vector3(-542.92, -179.23, 38.23),
            vector3(-542.11, -180.59, 38.23),
            vector3(-541.32, -181.97, 38.23)
        }
    }
}

function Translate(msg, ...)
    if Config.Locales[Config.Translation] then
        if Config.Locales[Config.Translation][msg] then
            return string.format(Config.Locales[Config.Translation][msg], ...)
        elseif Config.Translation ~= 'en' and Config.Locales['en'] and Config.Locales['en'][msg] then
            return string.format(Config.Locales['en'][msg], ...)
        else
            return 'Translation ['.. Config.Translation ..'] ['..msg..'] does not exist.'
        end
    elseif Config.Translation ~= 'en' and Config.Locales['en'] and Config.Locales['en'][msg] then
        return string.format(Config.Locales['en'][msg], ...)
    else
        return 'Translation ['.. Config.Translation .. '] not found.'
    end
end

local function detectFramework()
    if (GetResourceState('qb-core') == 'started') then return 'qb' end
    if (GetResourceState('qbox') == 'started') then return 'qb' end
    if (GetResourceState('es_extended') == 'started') then return 'esx' end
    return 'custom'
end

if Config.Framework == 'auto' then Config.Framework = detectFramework() end

local function detectPhone()
    if (GetResourceState('qb-phone') == 'started') then return 'qb-phone' end
    if (GetResourceState('qs-smartphone') == 'started') then return 'quasar' end
    if (GetResourceState('gksphone') == 'started') then return 'gksphone' end
    if (GetResourceState('lb-phone') == 'started') then return 'lbphone' end
    if (GetResourceState('yflip-phone') == 'started') then return 'yflip' end
    if (GetResourceState('okokPhone') == 'started') then return 'okokPhone' end
    if (GetResourceState('jpr-phonesystem') == 'started') then return 'jpr-phonesystem' end
    if (GetResourceState('roadphone') == 'started') then return 'roadphone' end
    return 'custom'
end

if Config.Phone == 'auto' then Config.Phone = detectPhone() end
webhooks.lua
cl_customizable_functions.lua
sv_customizable_functions.lua

Last updated

Was this helpful?