Brutal Scripts
YouTubeDiscordStore
  • 🙉About Us
  • ↗️Translate
  • Informations
    • 🔒Escrow System
    • 🔥Common Problems
  • Scripts
    • 📄Notify
      • Accessible files
      • Installation guide
    • 🔠Text-UI
      • Installation guide
      • Exports & How to use
      • Integrations
    • 🤟Gangs
      • Accessible files
      • Installation guide
      • exports / triggers
      • Create a new gang
    • 🏡Housing
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🔑Keys
      • Accessible files
      • Installation guide
      • exports / triggers
    • 💥Gang Actions
      • Accessible files
      • Installation guide
      • exports / triggers
      • Controlling the menu
    • ⭕Radial
      • Accessible files
      • Installation guide
      • Adding new buttons
    • 🎯Executions
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🐶Pets + K9 V2
      • Accessible files
      • Installation guide
    • 👮Police Job
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🚑Ambulance Job
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🔧Mechanic Job
      • Accessible files
      • Installation guide
      • exports / triggers
    • 💪GYM with Skills V2
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🔫Paintball
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🥊Boxing
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🔨Crafting
      • Accessible files
      • Installation guide
      • Creating a new crafting table
    • 🏦Banking
      • Accessible files
      • Installation guide
      • Paycheck transactions
      • Registering transactions
    • 🎳Bowling
      • Accessible files
      • Installation guide
      • exports / triggers
    • 🦌Hunting
      • Accessible files
      • Installation guide
    • 🏁Racing Script
      • Accessible files
      • Installation guide
    • 🐛Reports
      • Accessible files
      • Installation guide
    • 🛒Shop Robbery
      • Accessible files
      • Installation guide
    • 🛥️Yacht Heist
      • Accessible files
      • Installation guide
    • 🧾Billing
      • Accessible files
      • Installation guide
      • Triggers
    • 💰Truck Robbery
      • Accessible files
      • Installation guide
    • 🏧Atm Robbery
      • Accessible files
      • Installation guide
    • 👶Baby script
      • Installation guide
      • How to add more babys
  • Others
    • Register Key Mapping
    • Drill Minigame
    • Discord Webhook
Powered by GitBook
On this page
  • Asset download
  • Upload the SQL
  • Upload the items
  • Asset positioning
  • Setting up the Webhook
  • Setting the loaded event
  • Checking the Config file
  • Most important steps
  • Lockpicking Minigame
  • Setting up the core
  • If you got any error

Was this helpful?

  1. Scripts
  2. Gangs

Installation guide

Welcome to the Brutal Gangs installation guide, here you can learn how to completely install our asset.

PreviousAccessible filesNextexports / triggers

Last updated 2 months ago

Was this helpful?

If you don't have any experience in development we are highly recommend to follow each step in this documentation, and if you have a developer ask them to install the script for you as they have more experience.


Asset download

Once the purchase is made on our , you will receive your asset directly in your , in the Granted Assets panel you will see the asset, download it and do the following steps to install it correctly.

  • Put the script folder to your server.

  • Start the script in the server.cfg. (ensure brutal_gangs)

  • Restart your server! (And you get permission to use the script)


Upload the SQL

Do not rename your previous SQL or columns to adapt them to this system, use the complete database without making use of edits in your old databases.

CREATE TABLE IF NOT EXISTS `brutal_gangs` (
  `job` varchar(50) NOT NULL,
  `label` varchar(50) DEFAULT NULL,
  `level` int(11) DEFAULT 0,
  `datas` longtext DEFAULT NULL,
  `vehicles` longtext DEFAULT NULL,
  UNIQUE KEY `job` (`job`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

ALTER TABLE `users` 
ADD COLUMN `gang_rank` text NULL DEFAULT NULL,
ADD COLUMN `last_gang` text NULL DEFAULT NULL;
CREATE TABLE IF NOT EXISTS `brutal_gangs` (
  `job` varchar(50) NOT NULL,
  `label` varchar(50) DEFAULT NULL,
  `level` int(11) DEFAULT 0,
  `datas` longtext DEFAULT NULL,
  `vehicles` longtext DEFAULT NULL,
  UNIQUE KEY `job` (`job`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

ALTER TABLE `players` 
ADD COLUMN `gang_rank` text NULL DEFAULT NULL,
ADD COLUMN `last_gang` text NULL DEFAULT NULL;

Upload the items

If you don't have the items integrated correctly, you will receive random errors.

Check that you don't have duplicate items in your inventory or database before integrating them, otherwise you might have some errors.

This asset depends on certain items for its operation, so don't forget to integrate all items correctly into your database or inventory system, depending on how you use your server.

If your inventory is not among the following, you can create the file yourself using the examples of each item by displaying any of the following tabs.

Items for esx_inventory
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES
('spraycan', 'Spray Can', 1, 0, 1),
('sprayremover', 'Spray Remover', 1, 0, 1),
Items for qb-inventory
['spraycan'] 			 		 = {['name'] = 'spraycan', 						['label'] = 'Spray Can', 						['weight'] = 1, 		['type'] = 'item', 		['image'] = 'spraycan.png', 				['unique'] = false, 	['useable'] = false, 	['shouldClose'] = true,	   ['combinable'] = nil,   ['description'] = ''},
['sprayremover'] 			 			 = {['name'] = 'sprayremover', 							['label'] = 'Spray Remover', 						['weight'] = 1, 		['type'] = 'item', 		['image'] = 'sprayremover.png', 				['unique'] = false, 	['useable'] = false, 	['shouldClose'] = true,	   ['combinable'] = nil,   ['description'] = ''},
Items for qs-inventory
["spraycan"] = {
    ["name"] = "spraycan",
    ["label"] = "Spray Can",
    ["weight"] = 10,
    ["type"] = "item",
    ["image"] = "spraycan.png",
    ["unique"] = false,
    ["useable"] = false,
    ["shouldClose"] = true,
    ["combinable"] = nil,
    ["description"] = "Not have"
},

["sprayremover"] = {
    ["name"] = "sprayremover",
    ["label"] = "Spray Remover",
    ["weight"] = 10,
    ["type"] = "item",
    ["image"] = "sprayremover.png",
    ["unique"] = false,
    ["useable"] = false,
    ["shouldClose"] = true,
    ["combinable"] = nil,
    ["description"] = "Not have"
},
Items for ox-inventory
["spraycan"] = {
    label = "Spray Can",
    weight = 1,
    stack = true,
    close = false,
},

["sprayremover"] = {
    label = "Spray Remover",
    weight = 1,
    stack = true,
    close = false,
},

Asset positioning

Correctly position the assets in the server.cfg by following this step, if something goes wrong you will probably get errors about exports not found, do not skip this step!

-- First we will start the cores, never below
ensure es_extended or qb-core

-- The Notify / TextUI or target system / Progressbar / Inventory / Billing have to be above our asset
ensure [notify]
ensure [inventory]
ensure [billing]
ensure [textui] -- or target system 

-- Start the Brutal Gangs at the end
ensure brutal_gangs

Setting up the Webhook


Setting the loaded event

If you are using a multicharacter system then this step is really important to make our script working propetly! If you don't use any or the loaded event is the same as the basic core one then you are done with this step.

In the client-core.lua file go to the LoadedEvent variable and if you are using a different event then paste there your event which is used on your server.


Checking the Config file

Please make sure that you go through the whole file during the installation and check everything. It is one of the most important things as if you miss this step the script might won't work propetly.

Most important steps

The most important things always at the top of the config so pay the most attencion to these elements.

Setting the Core

Set your server's core wether it's using es_extended or qb-core, other cores aren't supported .

Setting the Notify
Setting the TextUI or Target

Set the TextUI from the options which are commented out. If your server using an other TextUI it is not a problem, you can set it up in the cl-utils.lua. If you want to use a target system then set the TextUI to false and set your target.


Lockpicking Minigame

Download this script to use the lockpicking minigame in the gang tasks.


Setting up the core

To use this script you will have to make some changes in your core. These steps have to be done to make our asset work 100%.

You have to use minimum the es_extended v1.7.5

If you have an older version you will have to create the gangs in the sql and you wont be able to use the editgangs panel!


  • Navigate to esx_extended/server/modules and import the createJob.lua file as you can see it on the image (even if the file is already there, you have to overwrite it):

If the 'modules' folder is not there you have to create it for yourself and then put the createJob.lua file inside of it!

  • Then open up the esx_extended/fxmanifest.lua file and add this line as you can see it on the image:

'server/modules/createJob.lua',
  • Navigate to qb-core/server/commands.lua and replace this command as you can see it on the image:

QBCore.Commands.Add('setgang', Lang:t('command.setgang.help'), { { name = Lang:t('command.setgang.params.id.name'), help = Lang:t('command.setgang.params.id.help') }, { name = Lang:t('command.setgang.params.gang.name'), help = Lang:t('command.setgang.params.gang.help') }, { name = Lang:t('command.setgang.params.grade.name'), help = Lang:t('command.setgang.params.grade.help') } }, true, function(source, args)
    local Player = QBCore.Functions.GetPlayer(tonumber(args[1]))
    if Player then
        local newGang = {name = tostring(args[2]):lower()}
        local lastGang = json.encode(Player.PlayerData.gang)

        gang = tostring(args[2]):lower()
        grade = tostring(tonumber(args[3])) or '0'
        if not QBCore.Shared.Gangs[gang] then return false end
        Player.PlayerData.gang.name = gang
        Player.PlayerData.gang.label = QBCore.Shared.Gangs[gang].label
        if QBCore.Shared.Gangs[gang].grades[grade] then
            local ganggrade = QBCore.Shared.Gangs[gang].grades[grade]
            Player.PlayerData.gang.grade = {}
            Player.PlayerData.gang.grade.name = ganggrade.name
            Player.PlayerData.gang.grade.level = tonumber(grade)
            Player.PlayerData.gang.isboss = ganggrade.isboss or false
        else
            Player.PlayerData.gang.grade = {}
            Player.PlayerData.gang.grade.name = 'No Grades'
            Player.PlayerData.gang.grade.level = 0
            Player.PlayerData.gang.isboss = false
        end

        if not Player.Offline then
            Player.Functions.UpdatePlayerData()
            TriggerEvent('QBCore:Server:OnGangUpdate', Player.PlayerData.source, Player.PlayerData.gang)
            TriggerClientEvent('QBCore:Client:OnGangUpdate', Player.PlayerData.source, Player.PlayerData.gang)
            TriggerEvent('brutal_gangs:server:qbcore-gang-update', Player.PlayerData.source, newGang, json.decode(lastGang))
        end
    else
        TriggerClientEvent('QBCore:Notify', source, Lang:t('error.not_online'), 'error')
    end
end, 'admin')

Navigate to qb-core/shared/gangs.lua and replace this file to this:

QBShared = QBShared or {}
QBShared.Gangs = {
    none = { label = 'No Gang', grades = { ['0'] = { name = 'Unaffiliated' } } },
}

Navigate to brutal_gangs/core/server-core.lua (line 225.) and replace this part as you can see it on the image:

function CreateCoreJob(name, label, grades)
        local gang = {}
        local newValue, newGrades = {}, {}

        for k,v in pairs(grades) do
            newValue[#newValue+1] = { id = tonumber(k), data = v }
        end

        table.sort(newValue, function(a, b)
            return a.id < b.id
        end)

        for k,v in pairs(newValue) do
            newGrades[v.id] = v.data
        end

        gang[name] = {
            label = label,
            grades = newGrades,
        }

        return exports['qbx_core']:CreateGangs(gang)
    end

  • Navigate to qbx_core/server/commands.lua and replace this command as you can see it on the image:

lib.addCommand('setgang', {
    help = locale('command.setgang.help'),
    params = {
        { name = locale('command.setgang.params.id.name'), help = locale('command.setgang.params.id.help'), type = 'playerId' },
        { name = locale('command.setgang.params.gang.name'), help = locale('command.setgang.params.gang.help'), type = 'string' },
        { name = locale('command.setgang.params.grade.name'), help = locale('command.setgang.params.grade.help'), type = 'number', optional = true }
    },
    restricted = 'group.admin'
}, function(source, args)
    local player = GetPlayer(args[locale('command.setgang.params.id.name')])
    if not player then
        Notify(source, locale('error.not_online'), 'error')
        return
    end

    local newGang = {name = args[locale('command.setgang.params.gang.name')]}
    local lastGang = json.encode(player.PlayerData.gang)

    local success, errorResult = player.Functions.SetGang(args[locale('command.setgang.params.gang.name')], args[locale('command.setgang.params.grade.name')] or 0)
    TriggerEvent('brutal_gangs:server:qbcore-gang-update', player.PlayerData.source, newGang, json.decode(lastGang))
    assert(success, json.encode(errorResult))
end)
  • Navigate to qbx_core/shared/gangs.lua and replace this file to this:

Before you do this step make sure that none of the players are in any gang in the sql

return {
    ['none'] = {
        label = 'No Gang',
        grades = {
            [0] = {
                name = 'Unaffiliated'
            },
        },
    },
}

Remove the basic gang scripts from your server

If you have any other gang creation scripts or anything similar, you don't need them anymore.

If you got any error

If you want to use the opportunnities which can be given by a webhook then you will have to set it up in our assets. You can do it by changeing a value to your in the sv-utils.lua file.

If you are using the then it is good news, you don't have to do anything. If you aren't then set the BrutalNotify value to false in the config and set up your own notify in the cl-utils.lua

If you followed the installational guide and the script still don't work or you get any errors the please check the common errors, here in the docs and in our server, for more informations.

official website
Keymaster
Click here if you haven't installed any script ever
Click here if you don't know how to upload the sql, here is a quick guide
Click here if you don't know how to upload the sql, here is a quick guide
discord webhook
Discord Webhook
Brutal Notify
discord
🤟
6KB
lockpick.zip
archive
2KB
createJob.lua
sv-utils.lua
client-core.lua
qb-core/server/commands.lua
brutal_gangs/core/server-core.lua
qbx_core/server/commands.lua
Page cover image