legacy-cityhall
Installation
Dependencies, database setup, and NUI build steps.
Installation
Dependencies
Install and start these before legacy-cityhall:
legacy-lib— provides the Framework/Inventory bridge,SendWebhook,CheckVersion, locale helpers, and theTargetexport used to add NPC interactions. legacy-cityhall's client script callsexports['legacy-lib']:Target()at resource start — iflegacy-libisn't already running, this will error.ox_lib— used throughout forlib.callback(client↔server NUI bridge) andlib.notify(toast notifications).oxmysql— used for all database access (MySQL.*).
Ensure your server.cfg (or resource manifest ordering) starts them in this order:
ensure oxmysql
ensure ox_lib
ensure legacy-lib
ensure legacy-cityhall
Database setup
- Import
sql/schema.sqlinto your database. This is destructive — it begins withDROP TABLE IF EXISTSfor all 7 tables (cityhall_jobs,cityhall_listings,cityhall_applications,cityhall_app_notes,cityhall_doc_types,cityhall_documents,cityhall_audit_log) in reverse dependency order. Never re-run it against a live server without a backup — existing jobs, listings, applications, documents, and audit history will be lost. - Optionally import any
sql/seed_jobs*.sqlfile to pre-populatecityhall_jobs/cityhall_listingsfor specific companion resources. These useINSERT ... ON DUPLICATE KEY UPDATEand are safe to re-run.- Before importing a seed file, confirm the
job_namevalues it inserts also exist in your framework's job list (e.g.qbx_core/shared/jobs.lua) — seed files only add the City Hall listing/config row, they do not create the underlying framework job. seed_jobs_17mov.sql'selectricianentry additionally requires the external Howdy-Minigame resource and a manual schema change:Neither of these is applied automatically.ALTER TABLE players ADD COLUMN electrocourses int(11) DEFAULT 0;
- Before importing a seed file, confirm the
NUI build
The in-game UI is a separate Vite + React + Tailwind project under web/. The resource ships and loads web/dist, not web/src.
cd web
npm install
npm run build
# outputs to web/dist, which the resource loads in-game
- Do not run
npm run devagainst a live FiveM client — it's a browser-only dev server for iterating on the UI, not something the game client can load. - If you edit locale strings or web UI source and don't rebuild, the running resource will keep serving the old
web/distwith no error.
Locales
locales/en.json is the single source of truth for UI text and is referenced via Config.Locale. To add a translation, create e.g. locales/fr.json with the same key structure and set Config.Locale = 'fr'.