Config

--   _      ____      _  _                 _ _             _           
--  (_)    |___ \    | || |               (_) |           (_)          
--   _  ___  __) | __| || |_ ___ _ __ _ __ _| |_ ___  _ __ _  ___  ___ 
--  | |/ __||__ < / _` || __/ _ \ '__| '__| | __/ _ \| '__| |/ _ \/ __|
--  | | (__ ___) | (_| || ||  __/ |  | |  | | || (_) | |  | |  __/\__ \
--  |_|\___|____/ \__,_| \__\___|_|  |_|  |_|\__\___/|_|  |_|\___||___/
--                   ______                                            
--                  |______|                                           

Config = {

    -- NECESSARY CONFIGURATION -- 
    framework = 'esx', -- esx | qb | qbox
    inventory = 'ox', -- ox | qb | qs
    language = 'en', -- language [en/pt]
    useQBGangs = true, -- Set to true to use QBCore gangs instead of jobs
    adminCommand = 'territory', -- /territory (create/delete)
    playerCommand = 'territories', -- /territories [territory list]
    dragUICommand = 'dragTerritoryUI',
    groups = {'admin', 'god'}, -- group required to manage territories
    debugging = {
        allowPrints = true, -- This will allow prints to be shown in the console
    },


    ItemNames = { -- define all the items you are using for crafting here
        ['borracha'] = { label = 'Borracha' },
        ['gunpowder'] = { label = 'Pólvora' },
        ['copper'] = { label = 'Cobre' },
        ['folha_papel'] = { label = 'Papel' },
        ['tinta'] = { label = 'Tinta' },
        ['clothe'] = { label = 'Roupa' },
        ['tecido'] = { label = 'Tecido' }
    },



    -- OPTIONAL CONFIGURATION --
    rankings = true, -- rank list and points for gangs? (true/false) (not user-friendly yet, but translated at least)  
    gangOnlyBlips = true, -- show blips only for gangs that are allowed to capture territories
    blipSprite = 310, -- blip sprite (https://docs.fivem.net/docs/game-references/blips/)
    minimumAttackers = 1,
    minPlayersOnlineToActions = 1,
    requireItemForCapture = true, -- Require player to have an item to capture a territory (true/false)
    itemForCapture = 'water', -- Item required to capture a territory
    itemForCaptureCount = 1, -- Amount of items required to capture a territory
    itemForCaptureRemove = true, -- Remove item from player inventory after capturing a territory (true/false)
    requireWeaponForCapture = false, -- Require player to be armed for capture
    useWeaponWhitelist = true, -- Use weapon whitelist for capturing territories (true/false)
    weaponWhitelist = { -- https://gtahash.ru/weapons/
        -- Add weapon hashes here. Examples:
        -- Example: WEAPON_PISTOL = 453432689
        -- Example: WEAPON_SMG = 736523883
        453432689, -- WEAPON_PISTOL
        736523883, -- WEAPON_SMG
        324215364, -- WEAPON_MICROSMG
        -1074790547, -- WEAPON_ASSAULTRIFLE
        -270015777, -- WEAPON_ASSAULTSMG
        -1660422300, -- WEAPON_COMBATMG
        -1312131151, -- WEAPON_GUSENBERG
    },
    moneyWashRatio = 0.5, -- 50% of the amount washed is lost
    capturing = 0.1, -- in minutes
    cooldown = 10, -- in minutes
    moneyWashCooldown = 5000, -- in ms
    moneyWashCooldownIncrease = 10, -- the amount it increases per item
    sellDuration = 5000, -- base duration in ms
    sellDurationIncrease = 500, -- ms per item sold (example value)
    buyDuration = 5000, -- in ms
    rewards = { -- reward is given only after successfully capturing the territory
        on = true, -- off (false) / on (true)
        item = 'black_money', -- item name
        count = 75000 -- amount
    },
    musicEnabled = false, -- Enable/disable music
    musicLink = "https://commondatastorage.googleapis.com/codeskulptor-demos/DDR_assets/Kangaroo_MusiQue_-_The_Neverwritten_Role_Playing_Game.mp3", -- or local resource path
    musicLoop = true, -- set to false if you don't want looping
    useFrameworkJobs = true, -- use framework jobs or custom jobs 
   

    gangs = { -- https://docs.fivem.net/docs/game-references/blips/ || gangs allowed to capture territories (job name) and blip color // You can use custom jobs/crews here
        vagos = { -- job
            blipColour = 5, -- blip color
            graffiti = 'sprays_vagos', -- graffiti name
            label = "Vagos",
            access = { 'craftingBlueprints', 'moneywashing', 'market', 'sellDrugs' }, -- access to selling territories
            capture = { 'craftingBlueprints', 'moneywashing', 'market', 'sellDrugs' } -- can capture selling territories
        },    
        groove = { -- job
            blipColour = 2, -- blip color
            graffiti = 'sprays_groove', -- graffiti name
            label = "Groove",
            access = { 'craftingBlueprints', 'moneywashing', 'market', 'sellDrugs' }, -- access to selling territories
            capture = { 'craftingBlueprints', 'moneywashing', 'market', 'sellDrugs' } -- can capture selling territories
        }, 
        ballas = { -- job
            blipColour = 27, -- blip color
            graffiti = 'sprays_ballas', -- graffiti name
            label = "Ballas",
            access = { 'craftingBlueprints', 'moneywashing', 'market', 'sellDrugs' }, -- access to selling territories
            capture = { 'craftingBlueprints', 'moneywashing', 'market', 'sellDrugs' } -- can capture selling territories
        },
    },

    terTypeInCreation = {
    { type = 'input', label =  'Territory Name'  },
    { type = 'input', label =  'Radius'  },
    { type = 'select', label =  'Territory Type', options = {
        { value = 'market', label =  'Market (Buy)' },
        { value = 'sellDrugs', label = 'Sell (Drugs)' },
        { value = 'sellWeapons', label = 'Sell (Weapons)' },
        { value = 'sellMisc', label = 'Sell (Miscellaneous)' },
        { value = 'moneywashing', label =  'Money Washing' },
        { value = 'craftingHeavyArmor', label = 'Craft (Armor)' },
        { value = 'craftingClip', label = 'Craft (Bullets)' },
        { value = 'craftingBlueprints', label = 'Craft (Blueprints)' }
    } },
    { type = 'checkbox', label = 'Give Reward on Capture', checked = true } 
},


    terType = {
        ['sellDrugs'] = {
            title = '🌿 Sell Drugs',
            event = 'ic3d_territories:sellList'
        },
        ['sellWeapons'] = {
            title = '🔫 Sell Weapons',
            event = 'ic3d_territories:sellList'
        },
        ['sellMisc'] = {
            title = '⚙️ Sell Misc',
            event = 'ic3d_territories:sellList'
        },
        ['moneywashing'] = {
            title = '💰 Lavagem',
            event = 'ic3d_territories:washMoney'
        },
        ['market'] = {
            title = '🛒 Buy',
            event = 'ic3d_territories:buyList'
        },
        ['craftingHeavyArmor'] = {
            title = '⚙️ Craft Armor',
            event = 'ic3d_territories:craftList'
        },
        ['craftingClip'] = {
            title = '⚙️ Craft Bullets ',
            event = 'ic3d_territories:craftList'
        },
        ['craftingBlueprints'] = {
            title = '⚙️ Craft Blueprints',
            event = 'ic3d_territories:craftList'
        }
    },


    craftingGroups = {

        craftingHeavyArmor = {
            ['heavyarmor'] = {
                label = 'Colete Pesado',
                requiredItems = {
                    ['tecido'] = 5,
                    ['clothe'] = 5,
                },
                image = 'nui://ox_inventory/web/images/heavyarmor.png',
                quantity = 3 -- Number of items crafted
            }
        },

        craftingClip = {
            ['weapon_revolver'] = {
                label = 'Revolver',
                requiredItems = {
                    ['pecas_armas'] = 13000,
                    ['blueprint_revolver'] = 700,
                    ['iron'] = 1300,
                },
                image = 'nui://ox_inventory/web/images/weapon_revolver.png',
                quantity = 1, -- Number of bullets crafted
                duration = 10000 -- 10 seconds crafting time
            },
            ['weapon_doubleaction'] = {
                label = 'Revolver Dourada',
                requiredItems = {
                    ['pecas_armas'] = 10000,
                    ['blueprint_revolver'] = 500,
                    ['iron'] = 1000,
                },
                image = 'nui://ox_inventory/web/images/weapon_doubleaction.png',
                quantity = 1, -- Number of bullets crafted
                duration = 10000 -- 10 seconds crafting time
            }
        },

        craftingBlueprints = {
            ['blueprint_pistol'] = {
                label = 'Blueprint Pistola',
                requiredItems = {
                    ['folha_papel'] = 10,
                    ['tinta'] = 3,
                },
                image = 'nui://ox_inventory/web/images/blueprint_pistol.png',
                quantity = 1, -- Number of bullets crafted
                duration = 5000 -- 10 seconds crafting time
            },
            ['blueprint_smg'] = {
                label = 'Blueprint SMG',
                requiredItems = {
                    ['folha_papel'] = 15,
                    ['tinta'] = 5,
                },
                image = 'nui://ox_inventory/web/images/blueprint_smg.png',
                quantity = 1, -- Number of bullets crafted
                duration = 5000 -- 10 seconds crafting time
            },
            ['blueprint_rifle'] = {
                label = 'Blueprint Rifle',
                requiredItems = {
                    ['folha_papel'] = 17,
                    ['tinta'] = 8,
                },
                image = 'nui://ox_inventory/web/images/blueprint_rifle.png',
                quantity = 1, -- Number of bullets crafted
                duration = 5000 -- 10 seconds crafting time
            },
            ['blueprint_shotgun'] = {
                label = 'Blueprint Shotgun',
                requiredItems = {
                    ['folha_papel'] = 17,
                    ['tinta'] = 8,
                },
                image = 'nui://ox_inventory/web/images/blueprint_shotgun.png',
                quantity = 1, -- Number of bullets crafted
                duration = 5000 -- 10 seconds crafting time
            },
            ['hqscale'] = {
                label = 'Balança',
                requiredItems = {
                    ['borracha'] = 20,
                    ['gunpowder'] = 10,
                    ['copper'] = 50,
                },
                image = 'nui://ox_inventory/web/images/hqscale.png',
                quantity = 1, -- Number of bullets crafted
                duration = 5000 -- 10 seconds crafting time
            },
        },

    },
    

    itemsToBuy = { -- buyable items if territory type is 'market'
        ['bread'] = {
            label = '🍞 | Bread',
            worth = 30,
            black = true, -- true = black money, false = cash
        },
        ['water'] = {
            label = '💧 | Water',
            worth = 20,
            black = true, -- true = black money, false = cash
        }
    },

    sellGroups = {
        sellDrugs = {
            ['weed'] = {
                label = '🌿 | Weed Brick',
                worth = 500000,
                black = true, -- true = black money, false = cash
            },
            ['coke'] = {
                label = '❄️ | Cocaine Brick',
                worth = 200000,
                black = true,
            },
        },
        sellWeapons = {
            ['weapon_pistol'] = {
                label = '🔫 | Pistol',
                worth = 150000,
                black = true,
            },
            ['weapon_assaultrifle'] = {
                label = '🔫 | Rifle',
                worth = 300000,
                black = true,
            },
        },
    },


    translations = {
        ['pt'] = {
            -- Notificações do Cliente    
            ['territory_weapon_not_allowed'] = "Tens de usar uma arma aprovada para capturar.",
            ['not_enough_attackers'] = 'Precisas de no minimo %s atacantes para capturar.',
            ['territory_requires_weapon'] = 'Precisas de estar armado para capturar territórios!',
            ['not_enough_items'] = 'You do not have enough %s!',
            ['no_territories_found'] = 'Não foram encontrados territorios.',  
            ['wash_money_title'] = 'Lavar Dinheiro',
            ['wash_money_label'] = 'Quantia a lavar',
            ['wash_money_placeholder'] = 'Insira a quantia',
            ['washing_money'] = 'Lavando dinheiro...',
            ['money_washed'] = 'Lavaste $%s com sucesso.',
            ['amount_washed'] = '%s washed $%s.',
            ['buying'] = 'A vender...',
            ['selling'] = 'A vender...',
            ['buying_canceled'] = 'Venda cancelada',
            ['selling_canceled'] = 'Venda cancelada',
            ['money_washing_canceled'] = 'Lavagem de dinheiro cancelada.',
            ['crafting_menu'] = 'Crafting Menu',
            ['required_items'] = 'Required Items: ',
            ['territory_no_acess'] = 'Your gang does not have access to this territory type',
            ['something_went_wrong'] = 'Algo correu mal!',
            ['fill_all_fields_out'] = 'Tens de preencher todos os campos corretamente!',
            ['incorrect_amount'] = 'O valor não pode ser inferior a 1!',
            ['territory_not_owned'] = 'Não és o dono deste território!',
            ['territory_already_owned'] = 'Este território já te pertence!',
            ['capture_in_progress'] = 'Alguém já está a capturar o território!',
            ['territory_on_cooldown'] = 'Este território foi capturado recentemente, ou a captura foi tentada!',
            ['too_far_away'] = 'Estás muito longe do território!',
            ['territory_captured'] = 'Capturaste com sucesso o %s!',
            ['territory_cause_death'] = 'Morriste, a progressão da captura parou!',
            ['territory_cause_distance'] = 'Saíste do território, a progressão da captura parou!',
            ['territory_show_text'] = '[E] - Territory: %s',
            ['territory_capture_progress_bar'] = 'CAPTURING..',
            -- Blips
            ['territory_blip_occupied'] = 'Território: %s | Dono: %s',
            ['territory_blip_unoccupied'] = 'Desocupado',
            -- Menu de Contexto do Cliente
            ['territory_menu_context_title'] = 'Lista de Territórios',
            ['territory_menu_title'] = '🎲 Territórios',
            ['territory_list_title'] = '🚩 Lista de Territórios',
            ['territory_list_metadata'] = 'Lista dos territórios.',
            ['territory_list_territory_name'] = '💀 %s',
            ['territory_list_territory_owner'] = '🚩 Dono: %s',
            ['territory_list_territory_capturing'] = 'A capturar: %s',
            ['territory_list_territory_cooldown'] = 'Cooldown: %s',
            ['territory_info_menu'] = '🎲 %s',
            ['territory_info_menu_capture'] = '🚩 Captura o território',
            ['territory_info_menu_stash'] = '📦 Armazém do território',
            ['territory_info_menu_sell'] = '🌿 Vender Loja',    
            ['select_item_to_sell'] = 'Vender Items',
            ['territory_info_menu_buy'] = '🛒 Comprar Loja',
            ['territory_info_menu_sell_title'] = 'Itens para Vender',
            ['territory_info_menu_buy_title'] = 'Itens para Comprar',
            ['territory_info_menu_buy_sell_price'] = '💸 Preço: $%s',
            ['territory_rankings_menu_context_title'] = 'Rankings',
            ['territory_rankings_title'] = '🏆 Rankings',
            ['territory_rankings_metadata'] = 'Mostra a lista de todas as organizações ilegais, assim como pontos...',
            ['territory_rankings_all_time'] = 'Pontos Totais: %s',
            ['territory_rankings_monthly'] = 'Pontos Mensais: %s',
            ['territory_rankings_weekly'] = 'Pontos Semanais: %s',
            ['territory_rankings_gang'] = '💀 %s',
            ['territory_rankings_position'] = '🏆 Posição: %s',
            ['territory_create_input'] = 'Criar um novo território',
            ['territory_create_name'] = 'Nome do Território',
            ['territory_create_radius'] = 'Raio',
            ['territory_create_type'] = 'Tipo de Território',
            ['territory_create_type_market'] = 'Mercado (Compras)',
            ['territory_create_type_dealer'] = 'Mercado (Vendas)',
            ['territory_create_type_default'] = 'Padrão (Apenas Armazém)',
            ['territory_create_type_crafting'] = 'Fabricação',
            ['territory_delete_input'] = 'Apagar um território',
            ['territory_delete_input_name'] = 'Nome do território',
            ['context_yes'] = 'Sim',
            ['context_no'] = 'Não',
            ['amount'] = 'Quantidade',
            -- Mensagens NUI
            ['defender_message'] = 'DEFENDING..',
            ['attacker_message'] = 'CAPTURING..',
            ['territory_lost'] = 'O teu território %s foi capturado por %s!',
            -- Notificações do Servidor
            ['territory_being_claimed'] = 'The unowned territory %s is being claimed by %s!',
            ['no_permission'] = 'Não tens permissão para usar este comando!',
            ['no_args'] = 'Uso: /territory [create/delete]',
            ['territory_already_exists'] = 'Já existe um território com esse nome!',
            ['territory_creation_failed'] = 'Falha ao criar o território!',
            ['territory_created'] = 'Território criado!',
            ['territory_deletion_failed'] = 'Falha ao apagar o território!',
            ['territory_deleted'] = 'Território apagado!',
            ['territory_being_attacked'] = 'Território: %s está a ser atacado por outra gangue!',
            ['territory_started_attacking'] = 'A tua gangue começou a atacar o território: %s',
            ['invalid_amount'] = 'Não tens essa quantidade!',
            ['not_enough_money'] = 'Não tens dinheiro suficiente!',
            ['not_enough_items'] = 'You do not have enough %s!',
            ['not_enough_space'] = 'Não tens espaço suficiente no teu inventário!',
            ['territory_reward'] = 'Recebeste $%s como recompensa por capturar: %s',
            ['already_used'] = 'Espera pelo reinício para usares o comando novamente.',
            ['territory_capture_ended'] = 'A captura foi terminada.',
            ['no_message'] = 'A mensagem está vazia.'
        },
        ['en'] = {
        -- Client Notifications      
            ['territory_weapon_not_allowed'] = "You must use an approved weapon for territory capture.",
            ['not_enough_attackers'] = 'You need at least %s attackers to capture.',
            ['no_territories_found'] = 'No territories found.',
            ['territory_requires_weapon'] = 'You need to be armed to capture territories!',
            ['not_enough_items'] = 'You do not have enough %s!',
            ['wash_money_title'] = 'Money Laundering',
            ['wash_money_label'] = 'Amount to wash',
            ['wash_money_placeholder'] = 'Enter the amount',
            ['washing_money'] = 'Washing money...',
            ['money_washed'] = 'You have successfully washed $%s.',
            ['amount_washed'] = '%s washed $%s.',
            ['buying'] = 'Buying...',
            ['selling'] = 'Selling...',
            ['buying_canceled'] = 'Purchase canceled',
            ['selling_canceled'] = 'Sale canceled',
            ['money_washing_canceled'] = 'Money laundering canceled.',
            ['crafting_menu'] = 'Crafting Menu',
            ['required_items'] = 'Required Items: ',
            ['territory_no_acess'] = 'Your gang does not have access to this territory type',
            ['something_went_wrong'] = 'Something went wrong!',
            ['fill_all_fields_out'] = 'You must fill out all fields correctly!',
            ['incorrect_amount'] = 'The amount cannot be less than 1!',
            ['territory_not_owned'] = 'You do not own this territory!',
            ['territory_already_owned'] = 'This territory already belongs to you!',
            ['capture_in_progress'] = 'Someone is already capturing the territory!',
            ['territory_on_cooldown'] = 'This territory was recently captured or an attempt was made!',
            ['too_far_away'] = 'You are too far from the territory!',
            ['territory_captured'] = 'You successfully captured %s!',
            ['territory_cause_death'] = 'You died, capture progress has stopped!',
            ['territory_cause_distance'] = 'You left the territory, capture progress has stopped!',
            ['territory_show_text'] = '[E] - Territory: %s',
            ['territory_capture_progress_bar'] = 'CAPTURING..',
            ['territory_lost'] = 'Your territory %s has been captured by %s!',

            -- Blips
            ['territory_blip_occupied'] = 'Territory: %s | Owner: %s',
            ['territory_blip_unoccupied'] = 'Unoccupied',
            
            -- Client Context Menu
            ['territory_menu_context_title'] = 'Territory List',
            ['territory_menu_title'] = '🎲 Territories',
            ['territory_list_title'] = '🚩 Territory List',
            ['territory_list_metadata'] = 'List of territories.',
            ['territory_list_territory_name'] = '💀 %s',
            ['territory_list_territory_owner'] = '🚩 Owner: %s',
            ['territory_list_territory_capturing'] = 'Capturing: %s',
            ['territory_list_territory_cooldown'] = 'Cooldown: %s',
            ['territory_info_menu'] = '🎲 %s',
            ['territory_info_menu_capture'] = '🚩 Capture Territory',
            ['territory_info_menu_stash'] = '📦 Territory Stash',
            ['territory_info_menu_sell'] = '🌿 Sell Shop',
            ['select_item_to_sell'] = 'Sell Items',
            ['territory_info_menu_buy'] = '🛒 Buy Shop',
            ['territory_info_menu_sell_title'] = 'Items to Sell',
            ['territory_info_menu_buy_title'] = 'Items to Buy',
            ['territory_info_menu_buy_sell_price'] = '💸 Price: $%s',
            ['territory_rankings_menu_context_title'] = 'Rankings',
            ['territory_rankings_title'] = '🏆 Rankings',
            ['territory_rankings_metadata'] = 'Shows all illegal organizations and their points...',
            ['territory_rankings_all_time'] = 'Total Points: %s',
            ['territory_rankings_monthly'] = 'Monthly Points: %s',
            ['territory_rankings_weekly'] = 'Weekly Points: %s',
            ['territory_rankings_gang'] = '💀 %s',
            ['territory_rankings_position'] = '🏆 Position: %s',
            
            ['territory_create_input'] = 'Create a new territory',
            ['territory_create_name'] = 'Territory Name',
            ['territory_create_radius'] = 'Radius',
            ['territory_create_type'] = 'Territory Type',
            ['territory_create_type_market'] = 'Market (Buy)',
            ['territory_create_type_dealer'] = 'Market (Sell)',
            ['territory_create_type_default'] = 'Default (Stash only)',
            ['territory_create_type_crafting'] = 'Crafting',
            
            ['territory_delete_input'] = 'Delete a territory',
            ['territory_delete_input_name'] = 'Territory Name',
            
            ['context_yes'] = 'Yes',
            ['context_no'] = 'No',
            ['amount'] = 'Amount',
            
            -- NUI Messages
            ['defender_message'] = 'DEFENDING..',
            ['attacker_message'] = 'CAPTURING..',
            
            -- Server Notifications
            ['territory_being_claimed'] = 'The unowned territory %s is being claimed by %s!',
            ['no_permission'] = 'You do not have permission to use this command!',
            ['no_args'] = 'Usage: /territory [create/delete]',
            ['territory_already_exists'] = 'A territory with that name already exists!',
            ['territory_creation_failed'] = 'Failed to create territory!',
            ['territory_created'] = 'Territory created!',
            ['territory_deletion_failed'] = 'Failed to delete territory!',
            ['territory_deleted'] = 'Territory deleted!',
            ['territory_being_attacked'] = 'Territory: %s is being attacked by another gang!',
            ['territory_started_attacking'] = 'Your gang started attacking territory: %s',
            ['invalid_amount'] = 'You do not have that amount!',
            ['not_enough_money'] = 'You do not have enough money!',
            ['not_enough_items'] = 'You do not have enough %s!',
            ['not_enough_space'] = 'You don’t have enough space in your inventory!',
            ['territory_reward'] = 'You received $%s for capturing: %s',
            ['already_used'] = 'Wait until restart to use this command again.',
            ['territory_capture_ended'] = 'The capture has been ended.',  
            ['no_message'] = 'Message is empty.'
        },

    },
}




-- DO NOT EDIT BELOW THIS LINE --

function insert(tbl, val, i)
    local index = i or (#tbl + 1)
    tbl[index] = val
end

function translateMessage(message)
    local lang = Config.translations[Config.language]
    if not lang[message] then
        print('Missing translation for: ' .. message)
        return message
    end

    return lang[message]
end

function debugPrint(msg)
    if not msg then return end
    if Config.debugging.allowPrints then
        print('[ic3d_territories] ' .. msg)
    end
end

Last updated

Was this helpful?