Cosmos Studios Docs
Discord
  • πŸ””Welcome to Cosmos Studios Docs!
  • πŸ‘¨β€πŸ’»Scripts
    • πŸ—ΊοΈTerritories
      • 🎨Features
      • πŸ“šInstallation
      • ⌨️Commands
      • βš™οΈConfiguration
      • πŸ€™Exports
        • Client
        • Server
Powered by GitBook
On this page
  • QBCore Installation
  • Database Configuration
  • Item Creation
  • Inventory images
  • ESX Installation
  • ESX Configuration
  1. Scripts
  2. Territories

Installation

A simple installation guide for cs-territories

QBCore Installation

If you are using qbcore make sure that in the "config.lua" file the Config.Framework section is set to "QBCore", otherwise change it to QBCore.

QBCore only supports inventories that work with the QBCore inventory table. If you are not using the qb-inventory, selling drugs to NPCs may not work, so it must be disabled.

If you have modified the "PlayerData" structure and the script has errors, you must make the table that receives the script equal to the default one. You can edit the tables that are received in "custom.lua" on serverside and clientside. If you have not modified the "default" table structure ignore this warning.

Database Configuration

In QBCore the script will only store the data in the script's .json file, it will not require any database.

ℹ️ Reset territories saved data

To reset the data of the territories, you will need to have the script or server stopped. Then, access the .json file named 'territories.json' and delete all the text.

Once the file is empty, write [] and save the changes. The structure will be regenerated when the script is restarted.

This will be what the .json will look like:

territories.json
[]

Item Creation

To add the preconfigured drug items you must go to "qb-core", shared, items.lua.

items.lua
-- CS-TERRITORIES
weed = { name = 'weed', label = 'Weed bag', weight = 100, type = 'item', image = 'weed.png', unique = false, useable = false, description = 'A small bag with weed' },
weed = { name = 'cocaine', label = 'Cocaine bag', weight = 100, type = 'item', image = 'cocaine.png', unique = false, useable = false, description = 'A small bag with cocaine' },
weed = { name = 'meth', label = 'Meth bag', weight = 100, type = 'item', image = 'meth.png', unique = false, useable = false, description = 'A small bag with meth' },

Inventory images


ESX Installation

The installation on ESX may take longer than on QBCore, so it's recommended to set up the script with time and patience.

To start, it will be necessary to set the section 'Config.Framework' in the 'config.lua' file to 'ESX' for the script to function correctly.

Excluding anything related to selling to NPCs, the only request the script will make to the core is to obtain the character identifier to create their table.

Config.DBConnector = "oxmysql" -- "oxmysql" or "icmysql"

All database connections are not encrypted with escrow. In case you want to use another connector or a different database, it can be modified by the user.

ESX Configuration

In ESX, we'll need to create gangs within the script. For this, we'll have an entire directory within the script dedicated to the 'minicore' so that organizations can function in ESX.

cs-territories\gangsystem It will be the directory containing everything related to player tables. This directory will not be protected by escrow, it will be entirely accessible to the user.

To add or modify organizations, you'll need to go to the 'gangs.lua' file within the 'shared' directory.

Last updated 1 year ago

In the ESX version, it will indeed be necessary to load the .sql file into the database. The script will come prepared to work with either or . This can be configured in the 'config.lua' file under the section 'Config.DBConnector'.

πŸ‘¨β€πŸ’»
πŸ—ΊοΈ
πŸ“š
oxmysql
icmysql
8KB
weed.png
image
16KB
cocaine.png
image
16KB
meth.png
image