Installation

Quasar Gangs & Territories brings structure and power to criminal roleplay in FiveM. Create gangs with custom ranks, colors, logos, stashes, and garages, all managed via an admin panel. Fight for map territories, earn XP, unlock upgrades, and grow influence through missions and wars.


Download Script

To download the assets needed for this script, you must access the official Cfx.re portal, where all assets purchased through Tebex are managed.

  1. Go to the following link: 🔗 https://portal.cfx.re/assets/granted-assets

  2. Log in with the same Cfx.re account you used to make the purchase.

  3. In the list of granted assets, find and download the following:

    • Gangs


Download Dependencies

This script requires some mandatory dependencies to function correctly. Make sure to download and extract them inside your server’s main directory, keeping their original folder structure intact.


Remove Other Scripts

This script may cause conflicts or errors if you use other gangs systems on your server. Common examples include qb-gangs, esx_gangs, or other similar gangs scripts. It’s strongly recommended to remove them completely before installation to prevent compatibility or functionality issues.


Server.cfg Placement

This script must always start after es_extended or qb-core, never before. We recommend placing it below them in your server.cfg, ensuring all dependencies are loaded first to prevent errors or unexpected behavior.


Database Setup

This script includes an essential database required for its operation. You must import it before starting your server, preferably using HeidiSQL or any other manager compatible with MariaDB/MySQL.

DATABASE ESX/QBCORE
DROP TABLE IF EXISTS `gangs`;
CREATE TABLE IF NOT EXISTS `gangs` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `name` VARCHAR(255) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
  `label` VARCHAR(255) NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
  `grades` TEXT NULL DEFAULT NULL COLLATE 'latin1_swedish_ci',
  PRIMARY KEY (`id`) USING BTREE
) COLLATE = 'latin1_swedish_ci' ENGINE = InnoDB;

DROP TABLE IF EXISTS `gangs_members`;
CREATE TABLE IF NOT EXISTS `gangs_members` (
  `index` INT(11) NOT NULL AUTO_INCREMENT,
  `gang` LONGTEXT NOT NULL DEFAULT '0' COLLATE 'utf8mb4_general_ci',
  `grade` LONGTEXT NOT NULL DEFAULT '0' COLLATE 'utf8mb4_general_ci',
  `cid` LONGTEXT NOT NULL DEFAULT '0' COLLATE 'utf8mb4_general_ci',
  `char` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
  PRIMARY KEY (`index`) USING BTREE
) COLLATE = 'utf8mb4_general_ci' ENGINE = InnoDB AUTO_INCREMENT = 9;

DROP TABLE IF EXISTS `gangs_money`;
CREATE TABLE IF NOT EXISTS `gangs_money` (
  `index` INT(11) NOT NULL AUTO_INCREMENT,
  `gang` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
  `amount` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
  PRIMARY KEY (`index`) USING BTREE
) COLLATE = 'utf8mb4_general_ci' ENGINE = InnoDB AUTO_INCREMENT = 2;

DROP TABLE IF EXISTS `gangs_territories`;
CREATE TABLE IF NOT EXISTS `gangs_territories` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `territory` INT(11) NOT NULL DEFAULT '0',
  `winner` VARCHAR(50) NOT NULL DEFAULT '' COLLATE 'utf8mb4_general_ci',
  `occupants` TEXT NULL DEFAULT NULL COLLATE 'utf8mb4_general_ci',
  PRIMARY KEY (`id`) USING BTREE
) COLLATE = 'utf8mb4_general_ci' ENGINE = InnoDB AUTO_INCREMENT = 1;

DROP TABLE IF EXISTS `gangs_dealers`;
CREATE TABLE `gangs_dealers` (
  `id` INT(11) NOT NULL AUTO_INCREMENT,
  `name` VARCHAR(50) NOT NULL DEFAULT '0' COLLATE 'latin1_swedish_ci',
  `territory` INT(11) NULL DEFAULT NULL,
  `coords` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb4_bin',
  `time` LONGTEXT NULL DEFAULT NULL COLLATE 'utf8mb4_bin',
  `createdby` VARCHAR(50) NOT NULL DEFAULT '0' COLLATE 'latin1_swedish_ci',
  PRIMARY KEY (`id`) USING BTREE
) COLLATE = 'latin1_swedish_ci' ENGINE = InnoDB AUTO_INCREMENT = 1;

DROP TABLE IF EXISTS `gangs_meta`;
CREATE TABLE IF NOT EXISTS `gangs_meta` (
  `identifier` VARCHAR(80) NOT NULL DEFAULT '' COLLATE 'utf8mb4_general_ci',
  `dealerrep` INT(11) NULL DEFAULT '0',
  PRIMARY KEY (`identifier`) USING BTREE
) COLLATE = 'utf8mb4_general_ci' ENGINE = InnoDB;

Command replacement

If you're using the QBCORE framework, it’s essential not to skip this step. To ensure compatibility with qs-gangs, you must remove the gang-related commands from the qb-core/server/commands.lua file. These commands conflict with the proper functioning of qs-gangs, causing errors during use.

Locate the gang commands in the file, such as /gang and /setgang, and delete or comment them out entirely. Removing these commands ensures the asset runs smoothly without interference from existing QBCORE functionality.

QBCore.Commands.Add('gang', Lang:t('command.gang.help'), {}, false, function(source)
    local PlayerGang = QBCore.Functions.GetPlayer(source).PlayerData.gang
    TriggerClientEvent('QBCore:Notify', source, Lang:t('info.gang_info', { value = PlayerGang.label, value2 = PlayerGang.grade.name }))
end, 'user')

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
        Player.Functions.SetGang(tostring(args[2]), tonumber(args[3]))
    else
        TriggerClientEvent('QBCore:Notify', source, Lang:t('error.not_online'), 'error')
    end
end, 'admin')