Skip to main content

Requirements

No database is required. The default storage backend is flat JSON files in data/ — see Storage backends below.

Steps

  1. Drop the nex_drugscreator folder into your resources, e.g. resources/[nex]/nex_drugscreator/.
  2. Add it to server.cfg after ox_lib and your framework:
    ensure ox_lib
    ensure es_extended # or qb-core / qbx_core
    ensure ox_inventory # if used
    ensure nex_drugscreator
    
  3. Grant access to the creator panel. Either add the ace permission:
    add_ace group.admin nex_drugscreator.admin allow
    
    …or rely on the default framework groups (admin, superadmin, god). A player passes if either check passes — see Configuration.
  4. Restart your server.
That’s it. Run /drugscreator in-game to open the panel.
The UI ships ready to use — no build step is needed.

Checking it worked

From F8:
lua print(GetResourceState('nex_drugscreator'))
Should print started. The server console also logs a line like:
loaded 3 drug(s) [framework: esx | ox_inventory: yes]
If it warns no framework detected, fix your server.cfg load order and restart.

Storage backends

Config.Storage in config.lua selects where drugs, zones, and runtime state are stored:
  • 'json' (default) — flat files in data/ (drugs.json, world.json, world_state.json). No extra dependencies.
  • 'mysql' — oxmysql with four tables prefixed nex_drugscreator_* (_drugs, _world, _meta, _state).
With 'mysql' you do not need to import any SQL manually. The tables are created automatically on first start, and any existing data/*.json files are imported once when the tables are empty — switching backends is lossless. A reference schema ships in sql/nex_drugscreator.sql if you want to review it.
If Config.Storage = 'mysql' but oxmysql isn’t running, the resource logs an error and falls back to JSON storage.

Updating

config.lua and bridge/server/*.lua are listed under escrow_ignore, so keep your edited copies when replacing the resource files. If you use JSON storage, your data lives in data/drugs.json, data/world.json, and data/world_state.jsonkeep these files when updating. Older saves migrate automatically on start (v1 effect layouts, selling channel flags, field modes). The resource checks the published version manifest on start and prints a console notice when a newer build is available.