legacy-shops
Installation
Dependencies, database setup, and server.cfg configuration.
Installation
1. Dependencies
Install and start these before legacy-shops:
| Resource | Why |
|---|---|
legacy-lib |
Framework/inventory bridge, Target integration, version checking, webhook sending, and the data/shops.json Store used for live shop state. |
ox_lib |
lib.callback (every server endpoint) and lib.notify (client-side error/status messages). |
oxmysql |
Executes the one-time SQL migration read and keeps legacy_shops_history live. |
Optional, soft dependency:
| Resource | Why |
|---|---|
legacy-blipmanager |
Enables the all/closest/none shop blip visibility toggle. If absent, blips still work in a default mode — see Troubleshooting. |
2. Database setup
Run install.sql against your database once, before first starting the resource:
mysql your_database < install.sql
This creates five tables (all CREATE TABLE IF NOT EXISTS, safe to re-run):
legacy_shopslegacy_shops_categorieslegacy_shops_itemslegacy_shops_presetslegacy_shops_history
legacy_shops, legacy_shops_categories, legacy_shops_items, and legacy_shops_presets are only read once, automatically, on first boot to migrate a legacy install into data/shops.json. After that, they are no longer consulted — legacy_shops_history is the only one that stays live as an ongoing purchase log.
3. Resource start order
In server.cfg, ensure dependencies start first:
ensure oxmysql
ensure ox_lib
ensure legacy-lib
ensure legacy-blipmanager
ensure legacy-shops
4. Build the NUI (only if you modify the frontend)
The resource ships with a pre-built web/dist. If you change anything under web/src, rebuild it:
cd web
npm install
npm run build # outputs to web/dist, which the resource loads as NUI
5. Configure
Edit config.lua to set your desired creator command, restock/fluctuation behaviour, blip defaults, ped presets, and Discord webhooks. See Configuration for the full key reference.
6. Verify
- Start the server and confirm no
^1[legacy-shops] ShopPresets is missing...^0warning appears in console (this would meanserver/presets.luafailed to load beforeserver/server.lua). - As an admin in-game, run the command set in
Config.CreatorCommand(defaultshopcreator) to open the creator UI and confirm presets/ped models populate.