Installation
Dependencies and setup steps.
1. Dependencies
Install and start these resources before legacy-shops:
legacy-lib— shared framework bridge (jobs, inventory, accounts, licences, webhooks, targeting) and NUI theme/branding source.ox_lib— used for callbacks (lib.callback) and client notifications (lib.notify).oxmysql— MySQL driver used for the SQL-backed purchase history and first-boot migration.
2. Database
Import install.sql into your database before starting the resource for the first time:
mysql -u user -p your_database < install.sql
This creates:
legacy_shopslegacy_shops_categorieslegacy_shops_itemslegacy_shops_presetslegacy_shops_history
All tables use CREATE TABLE IF NOT EXISTS, so re-running the script is safe, but schema changes between resource versions are not applied automatically — existing installations may need manual ALTER TABLE statements when upgrading.
On first boot (only if
data/shops.jsondoes not yet exist), legacy-shops readslegacy_shops,legacy_shops_categories,legacy_shops_itemsandlegacy_shops_presetsonce and migrates them intodata/shops.json. After that migration, those tables (other thanlegacy_shops_history, which stays live) are no longer read.
3. server.cfg
Ensure the correct start order:
ensure oxmysql
ensure ox_lib
ensure legacy-lib
ensure legacy-shops
4. NUI frontend (optional, only if building from source)
The NUI is a separate Vite/React project under web/. If you're modifying the UI:
cd web
npm install
npm run build # outputs to web/dist, which the resource loads as its NUI page
Use npm run dev for local iteration and npm run preview to preview a production build. Editing web/dist directly will be overwritten on the next build.
5. Localization
UI text lives in locales/en.json and locales/sv.json as plain key/value JSON. Keep both files' key sets in sync — there is no documented fallback for missing keys.
