Studios
Drugshouse-3.jpg

Installation

SoonDrugsQbox
PAGE 02 OF 07  ·  OVERVIEW → INSTALLATION → CONFIGURATIONdocs.glitchstudios.dev
Browse docs

Requirements#

The server

Framework qbx_core (Qbox). ESX and plain QBCore are not supported.
Resources ox_lib, oxmysql, ox_target, ox_inventory
Server OneSync enabled.
Database MariaDB or MySQL through oxmysql. The tables are created on first start.
Tested with qbx_core 1.24.0, ox_inventory 2.48.0, ox_lib 3.40.0, ox_target 1.17.2 and oxmysql 2.14.2.

Optional

Each of these is detected at run time. When one is missing, its feature is skipped or falls back to Config.Fallbacks.

Resource What it adds
glitch-criminaltablet The Botanist and the Cartel as tablet contacts, contact trust, REP to meet the Cartel, crew batch caps and the tablet map. Without it every player gets Config.Fallbacks.trust (100) and anyone may meet the Cartel.
glitch-xpSystem Growing, chemistry and dealing XP, the growing perks and the seed level gates in Config.SeedLevels.
glitch-minigames The lab, grow lab and gummy minigames. Without it an ox_lib skill check runs instead.
glitch-drugSales Street selling, and the sales total that also lets a player meet the Cartel.
glitch-stores A shop screen for the Botanist and the weed shop. Without it the Botanist uses ox_lib menus and the weed shop opens the plain ox_inventory shop.
glitch-buffs Drug tolerance, overdoses, fatigue and the greened-out debuff.
glitch-admin Staff logs, live map plant pins and Discord staff roles for Config.Gummies.staffRoles.
glitch-economy The crime ledger.
glitch-pauseMenu Blip names in the pause menu map legend.
glitch-poolcleaning Counts and checks the net events players send to this resource.
glitch-uiElements The drawer style for the gummy screens (Config.Gummies.panel = 'drawer').
glitch-ambulancejob Joints and gummies dull injury pain.
sd-phone Plot watch texts and grow lab rent and power mail.
rc-interactions Dialogue with the contacts.
ps-dispatch Police alerts. Without it on-duty police get a notification and a blip.
bob74_ipl Loads the biker weed farm interior the grow labs use.
cfx_gn_warehouses The G&N Studio warehouses MLO, location 6 with its coke lab entity set on. The default coke lab stations sit inside it.

Installation steps#

  1. Put the glitch-drugs folder in your resources folder. The folder name is case-sensitive.

  2. Add the entries from install/ox_inventory_items.lua to ox_inventory/data/items.lua, skipping any item you already have. Copy the pictures from install/images to ox_inventory/web/images. They cover every item except six that most item packs already include (empty_weed_bag, rolling_paper, baking_soda, weed_brick, coke_brick and crack_baggy), plus the 48 gummy pack pictures (thc_gummy_<shape>_<colour>.png).

  3. Make sure these common items exist too: black_money, jerry_can (or the WEAPON_PETROLCAN weapon), energy_drink, and rolling_paper in a shop your players use.

  4. Optional starter shop: copy the WeedShop entry from install/ox_inventory_shop.lua to ox_inventory/data/shops.lua, or set Config.WeedShop.enabled = false.

  5. The tables are created when the resource starts. If your database user cannot create tables, run sql/install.sql once by hand and set Config.ManualDatabaseSetup = true.

  6. Add to server.cfg, after ox_lib, oxmysql, qbx_core, ox_inventory and ox_target, and after any optional resource you use:

    ensure glitch-drugs
    add_ace group.admin glitch-drugs.admin allow
    add_ace group.admin command.cokelab allow
    
  7. Set the positions for your map: the contacts (Config.Contacts), the coke lab stations and field, the weed shop (Config.WeedShop.coords) and the grow lab doors (Config.Lab.sites in shared/lab.lua). The lab stations and the field are easiest to place with /cokelab in the city. That saves them to data/lab.json and data/field.json (both ship empty), and from then on those files win over Config.Coke.stations and Config.CocaField.center. Delete a file to go back to the config.

  8. Restart the server.

[!NOTE] The default coke lab stations are inside the cfx_gn_warehouses MLO. The console warns at start when the stations are still on the defaults and the MLO is not installed.

[!NOTE] The old it-drugs ACE still works while Config.LegacyAce is set. Set Config.LegacyAce = false on a new install.

Permissions#

ACE What it allows
glitch-drugs.admin /drugadmin plants, /getGroundHash and the grow lab Admin tab.
command.cokelab /cokelab (the command is also restricted to group.admin).

Updating#

The resource runs next to it-drugs, because net events and callbacks use the glitch-drugs: prefix. When upgrading from it-drugs, the drug_plants table is reused and gets a glitch column, and existing plants roll genes on first start. Keep your edits to shared/config.lua, shared/lab.lua, data/lab.json and data/field.json when you replace the other files. Database changes apply themselves on start.