Requirements
- FiveM server
ox_lib(required)- One of:
es_extended,qb-core, orqbx_core - (Optional)
ox_inventory— used automatically when running - (Optional)
oxmysql— only whenConfig.Storage = 'mysql'
No database is required. The default storage backend is flat JSON files in
data/ — see Storage backends below.Steps
-
Drop the
nex_drugscreatorfolder into your resources, e.g.resources/[nex]/nex_drugscreator/. -
Add it to
server.cfgafter ox_lib and your framework: -
Grant access to the creator panel. Either add the ace permission:
…or rely on the default framework groups (
admin,superadmin,god). A player passes if either check passes — see Configuration. - Restart your server.
/drugscreator in-game to open the panel.
The UI ships ready to use — no build step is needed.
Checking it worked
From F8:started. The server console also logs a line like:
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 indata/(drugs.json,world.json,world_state.json). No extra dependencies.'mysql'— oxmysql with four tables prefixednex_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.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.json — keep 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.
