Cube Scripts

Installation

Install Cube Gang and create your first organisation in a few minutes.

1

Download the resource#

After your purchase, the resource is delivered to your CFX account. Download it from the CFX Portal, under Granted assets.

Note

Sign in with the same CFX.re account you used at checkout. If the asset is not listed, open a ticket on our Discord and we will look into it.

Unzip the folder into your server's resources directory. There is nothing to build - the interface ships already compiled in ui/build/.

Warning

Keep the folder named cube_gang. Exports and events in your other scripts use the resource name, for example exports.cube_gang:GetPlayerGang(source).

2

Install the dependencies#

These resources are required and must start before Cube Gang.

  • ox_lib
  • One database resource: oxmysql

    (recommended), mysql-async or ghmattimysql

OneSync must be enabled on your server.

3

Add it to your server.cfg#

server.cfg
ensure oxmysql
ensure ox_lib
ensure es_extended   # or qb-core / qbx_core
ensure ox_target     # optional
ensure ox_inventory  # optional
ensure cube_gang

Start Cube Gang after your framework, target and inventory so it can detect them.

4

Grant admin access#

The creators (/gangcreator and /zonecreator) are restricted to admins. Access is granted by an ace permission or a framework group.

server.cfg
add_ace group.admin cubegang.admin allow
add_principal identifier.fivem:1234567 group.admin
config.luaLua
Config.AdminAce = 'cubegang.admin'
Config.AdminGroups = { 'admin', 'superadmin', 'god' }
5

Start the server#

On the first start, Cube Gang checks your database and creates everything it needs:

  • the cube_gangs, cube_gang_ranks, cube_gang_points, cube_gang_treasury,

    cube_gang_zones, cube_gang_zone_influence and cube_gang_drug_sales tables

  • a cube_gang column in your player table (users on ESX, players on

    QBCore and Qbox) that stores the gang of each character

Note

Every table and column is checked before being created, so restarting the resource or updating it never touches your existing data.

With Config.Debug = true you will see what was detected:

Code
[cube_gang] Started | Framework: esx | Target: ox_target | Inventory: ox_inventory | Dispatch: builtin | Database: oxmysql
[cube_gang] Loaded 0 gangs and 0 territories
6

Create your first gang#

Run the creator in game:

Code
/gangcreator
  1. Click New organisation, pick a name, a type, a color and a logo.
  2. Adjust the ranks and their permissions.
  3. Place the gang points (boss menu, stash, treasury, garage).
  4. Pick the leader among the online players and save.
7

Draw your first territory#

Open the Territories page of the creator and click New zone to draw it on the map, or Create in game to draw it with the free camera.

Code
/zonecreator

See Territories to understand how gangs take control of a zone.

Gang logos#

A logo can be a direct link (https://...png) or a file name. Files are loaded from:

Code
cube_gang/ui/build/assets/images/logos/

Drop ballas.png in that folder and type ballas.png in the logo field. A square PNG with a transparent background gives the best result on the map.