QBESXStandalone
Agency-Gangs Installation
The complete gang system for FiveM in one script.
v1.0.0Paid5 Pages

01Installation
- 1Extract Agency-Gangs into your resources folder
- 2Add ensure Agency-Gangs to server.cfg, after your framework, your inventory and oxmysql
- 3Start the server: the database tables are created on the first start (sql/install.sql is only needed if your database user may not create tables)
- 4Copy the five item images from install/images into the image folder of your inventory
- 5ox_inventory: add the five items from the README to ox_inventory/data/items.lua. QBCore and QBox inventories get the items at runtime, ESX runs the INSERT at the end of sql/install.sql
- 6Give admins the panel with add_ace group.admin agency.gangs allow
- 7Open /agangs in game, create a gang and place its hideout points in the gang editor, or import your existing gangs on the Import page
02Dependencies
oxmysql (required)OneSync (required)QBCore, QBox or ESX (optional, runs standalone without one)An inventory (optional: ox_inventory, qb-inventory, ps-inventory, lj-inventory, jpr-inventory, qs-inventory or codem-inventory, found automatically)Agency Phone and Agency Pad (optional, add the Gangs app)Agency Housing (optional, gang house)Agency Blackmarket (optional, gang discount and gang bank payment)Agency-Garage or jg-advancedgarages (optional, members' own cars at the gang garage)ox_target or qb-target (optional, otherwise the key prompt is used)Agency-Notify (optional, otherwise the notifications of your framework are used)Agency-Companion (optional, free: links the script with the Agency Companion app through /app)
03SQL File
Optional: the resource creates these tables on its own when it starts. Import this file only if you set up the database by hand:
-- Agency Gangs: the script creates these tables by itself on the first start.
-- Run this file only if your database user may not create tables.
CREATE TABLE IF NOT EXISTS `agency_gangs` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(50) NOT NULL,
`label` VARCHAR(64) NOT NULL,
`leader` VARCHAR(64) NULL,
`bank` BIGINT NOT NULL DEFAULT 0,
`dirty` BIGINT NOT NULL DEFAULT 0,
`xp` INT NOT NULL DEFAULT 0,
`data` LONGTEXT NULL,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `agency_gang_members` (
`identifier` VARCHAR(64) NOT NULL,
`gang_id` INT NOT NULL,
`grade` INT NOT NULL DEFAULT 0,
`name` VARCHAR(100) NULL,
`joined_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_seen` TIMESTAMP NULL DEFAULT NULL,
PRIMARY KEY (`identifier`),
KEY `gang_id` (`gang_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `agency_gang_logs` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`gang_id` INT NOT NULL,
`category` VARCHAR(20) NOT NULL,
`actor` VARCHAR(100) NULL,
`message` VARCHAR(255) NOT NULL,
`amount` BIGINT NULL,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `gang_id` (`gang_id`, `id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `agency_gang_territories` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(50) NOT NULL,
`label` VARCHAR(64) NOT NULL,
`x` DOUBLE NOT NULL, `y` DOUBLE NOT NULL, `z` DOUBLE NOT NULL,
`radius` DOUBLE NOT NULL DEFAULT 150,
`income` INT NOT NULL DEFAULT 0,
`owner` INT NULL DEFAULT NULL,
`captured_at` INT NULL DEFAULT NULL,
`data` LONGTEXT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `agency_gang_graffiti` (
`id` INT NOT NULL AUTO_INCREMENT,
`gang_id` INT NOT NULL,
`x` DOUBLE NOT NULL, `y` DOUBLE NOT NULL, `z` DOUBLE NOT NULL,
`nx` DOUBLE NOT NULL, `ny` DOUBLE NOT NULL, `nz` DOUBLE NOT NULL,
`territory` INT NULL DEFAULT NULL,
`created_at` INT NOT NULL,
`text` VARCHAR(24) NULL,
`style` VARCHAR(12) NULL,
`size` VARCHAR(2) NULL,
PRIMARY KEY (`id`),
KEY `gang_id` (`gang_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE IF NOT EXISTS `agency_gang_wars` (
`id` INT NOT NULL AUTO_INCREMENT,
`kind` VARCHAR(10) NOT NULL,
`attacker` INT NULL, `defender` INT NULL,
`wager` BIGINT NOT NULL DEFAULT 0,
`status` VARCHAR(12) NOT NULL,
`started` INT NULL, `ends` INT NULL,
`winner` INT NULL,
`data` LONGTEXT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- ESX only: the new items (QBCore / QBox get them automatically, ox_inventory see README).
-- INSERT IGNORE INTO `items` (`name`, `label`, `weight`) VALUES
-- ('spraycan', 'Spray Can', 1), ('spray_remover', 'Spray Remover', 1), ('zipties', 'Zip Ties', 1),
-- ('head_bag', 'Head Bag', 1), ('gang_contract', 'Gang Contract', 1);