đŸ”Ŧ
RX Scripts
STOREDISCORD
  • 👋Overview
  • Find us
    • 🔗Store
    • 🔗Discord
    • 🔗Youtube
  • 🌐Scripts
    • Garages
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Reports PRO
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Mining
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Fishing
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Player Stores
      • đŸ› ī¸Installation
      • 🚚Jobs DLC
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Drug Labs
      • đŸ› ī¸Installation
      • âœˆī¸Operation DLC
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Hunting
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Plantation
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Gang Wars
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Events
    • Housing
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Events
    • Chopshop
      • đŸ› ī¸Installation
      • 📝Configurables
    • Death System
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Events
    • Recyclers
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Smelters
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Crates & Storages
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Šī¸Exports
      • â†Šī¸Events
    • Black Markets
      • đŸ› ī¸Installation
      • 📝Configurables
    • Hazard Zones
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Report System
      • đŸ› ī¸Installation
      • 📝Configurables
      • â†Ēī¸Exports
      • â†Šī¸Events
    • Billing System
      • đŸ› ī¸Installation
      • â†Ēī¸Exports
      • â†Šī¸Events
Powered by GitBook
On this page
  1. Scripts
  2. Gang Wars

Configurables

--[[
BY RX Scripts Š rxscripts.xyz
--]]

Config.DiscordWebhook = 'https://discordapp.com/api/webhooks/1163094573434814464/Q4u2iwVW__VdfgEzsW3UpC7DGGg7bgSxSUhJTIbayGVhMzJiIVcrv5KDmW_rHqB2kpUn'
Config.UseItem = 'wartablet' -- If false then enables command to open the interface instead of an item
Config.UseMoney = ESX and 'money' or 'cash' -- Money type used for all money transactions

Config.OpenInterfaceCommand = "wartablet" -- Command to open the interface (only if UseItem is false)
Config.EndWagerCommand = "endwar" -- Command to end a war

Config.DisplayEnemyDistance = 100.0 -- From how far the players in active wars sees the enemy visibilities
Config.DisplayEnemyTitle = true
Config.DisplayEnemyMarker = true
Config.KillsToWin = 2 -- How many kills to win the war
Config.WagerMinimum = 100000 -- Minimum wager amount
Config.WagerMaximum = 10000000 -- Maximum wager amount

Config.TabletAnim = { -- Tablet opening animation
    dict = "amb@code_human_in_bus_passenger_idles@female@tablet@base",
    anim = "base",
}

Config.Gangs = { -- Match the key names with the job/gang names from the Jobs table
    ["ballas"] = {
        Label = "Ballas",
        Image = "ballas.png",
        RequiredGrades = { -- Minimum grades required to use the interface for each action
            sendWar = 2,
            revokeWar = 2,
            acceptWar = 2,
            declineWar = 2,
            manageBalance = 2,
        } 
    },
    ["bloods"] = {
        Label = "Bloods",
        Image = "bloods.png",
        RequiredGrades = { -- Minimum grades required to use the interface for each action
            sendWar = 2,
            revokeWar = 2,
            acceptWar = 2,
            declineWar = 2,
            manageBalance = 2,
        }
    },
    ["vagos"] = {
        Label = "Vagos",
        Image = "vagos.png",
        RequiredGrades = { -- Minimum grades required to use the interface for each action
            sendWar = 2,
            revokeWar = 2,
            acceptWar = 2,
            declineWar = 2,
            manageBalance = 2,
        } 
    },
}

Config.GroupsToEndWagers = { -- Groups that can end wagers with /endwager {gang}
    "superadmin",
    "admin",
    "mod",
}

--[[
    INITIALIZATION SECTION

    ONLY UNCOMMENT/CHANGE THIS IF YOU HAVE RENAMED SCRIPTS SUCH AS FRAMEWORK, TARGET, INVENTORY ETC
    RENAME THE SCRIPT NAME TO THE NEW NAME
--]]
-- ESX = 'es_extended'
-- QB = 'qb-core'
-- OXInv = 'ox_inventory'
-- QBInv = 'qb-inventory'
-- QBAmbu = 'qb-ambulancejob'
IgnoreResourceNotFoundErrors = false
--[[
BY RX Scripts Š rxscripts.xyz
--]]

function Notify(src, msg, type)
    if ESX then
        TriggerClientEvent('esx:showNotification', src, msg, type)
    elseif QB then
        TriggerClientEvent('QBCore:Notify', src, msg, type)
    else
        -- Your own notification system
    end
end

function HasGroup(src, group)
    if ESX then
        return ESX.GetPlayerFromId(src).getGroup() == group
    elseif QB then
        return QB.Functions.HasPermission(src, group)
    else
        -- Your own group/admin system
    end
end

function GetJob(src)
    if ESX then
        return ESX.GetPlayerFromId(src).job
    elseif QB then
        return QB.Functions.GetPlayer(src).job
    else
        -- Your own job system
    end
end

function GetGang(src)
    if ESX then
        return GetJob(src)
    elseif QB then
        return QB.Functions.GetPlayer(src).PlayerData.gang
    else
        -- Your own gang system
    end
end

function GetGangGrade(src)
    local gang = GetGang(src)

    if ESX then
        return gang.grade
    elseif QB then
        return gang.grade.level
    else
        -- Your own gang system
    end
end

---@return table sources
function GetOnlineGangMembers(gang)
    local sources = {}

    if ESX then
        local players = ESX.GetExtendedPlayers('job', gang)
        for k, v in pairs(players) do
            sources[#sources+1] = v.source
        end
    elseif QB then
        local players = QB.Functions.GetPlayers()
        for i = 1, #players do
            local player = players[i]
            local playerGang = GetGang(player).name
            if playerGang == gang then
                sources[#sources+1] = player
            end
        end
    else
        -- Your own job system
    end

    return sources
end

function GetMoney(src, type)
    if ESX then
        return ESX.GetPlayerFromId(src).getAccount(type).money
    elseif QB then
        return QB.Functions.GetPlayer(src).PlayerData.money[type]
    end
end

function RemoveMoney(src, type, amount)
    if ESX then
        ESX.GetPlayerFromId(src).removeAccountMoney(type, amount)
    elseif QB then
        QB.Functions.GetPlayer(src).Functions.RemoveMoney(type, amount)
    end
end

function AddMoney(src, type, amount)
    if ESX then
        ESX.GetPlayerFromId(src).addAccountMoney(type, amount)
    elseif QB then
        QB.Functions.GetPlayer(src).Functions.AddMoney(type, amount)
    end
end
--[[
BY RX Scripts Š rxscripts.xyz
--]]

function Notify(msg, type)
    if ESX then
        ESX.ShowNotification(msg, type)
    elseif QB then
        QB.Functions.Notify(msg, type)
    else
        -- Your own notification system
    end
end

function IsPlayerLoaded()
    if ESX then
        return ESX.GetPlayerData() and ESX.GetPlayerData().job
    elseif QB then
        return QB.Functions.GetPlayerData() and QB.Functions.GetPlayerData().job
    else
        -- Your own player loaded system
    end
end

function GetPlayerData()
    if ESX then
        return ESX.GetPlayerData()
    elseif QB then
        return QB.Functions.GetPlayerData()
    else
        -- Your own player data system
    end
end

function GetJob()
    if ESX then
        return ESX.GetPlayerData().job
    elseif QB then
        return QB.Functions.GetPlayerData().job
    else
        -- Your own job system
    end
end

function GetGang()
    if ESX then
        return GetJob()
    elseif QB then
        return QB.Functions.GetPlayerData().gang
    else
        -- Your own gang system
    end
end

function GetGangGrade()
    local gang = GetGang()

    if ESX then
        return gang.grade
    elseif QB then
        return gang.grade.level
    else
        -- Your own gang system
    end
end
PreviousInstallationNextEvents

Last updated 1 year ago

🌐
📝