Installing cc_government
Ten minutes, start to finish. Every step says how to check it worked.
Ten minutes, start to finish. Every step says how to check it worked.
1. Requirements
| Need | Version | Why |
|---|---|---|
cc_lib | 1.12.0 or newer (free) | Framework, money, target, notify bridge |
oxmysql | any current | Storage |
| A framework | ESX Legacy, QBCore, Qbox, ox_core, or none | Detected by cc_lib |
| MariaDB 10.0.2+ or MySQL 8.0.29+ | ADD COLUMN IF NOT EXISTS for upgrades |
Optional, detected at runtime: a target script (ox_target, qb-target, ...; without one cc_lib shows an [E] prompt), a notify script, a society/banking provider for department funding and sweeps, an inventory for the optional wallet item, tcc_gms as the licence registry.
2. Files and server.cfg
Put the cc_government folder anywhere under resources/ (the folder name must stay cc_government: the page and the events use it). Then in server.cfg, after your framework and cc_lib:
ensure oxmysql
ensure cc_lib
ensure cc_government
# Who can run elections, appoint the mayor and announce as staff
add_ace group.admin cc_government.admin allow
# Who can grant/revoke lawyer licences and sits on the bar panel
add_ace group.admin cc_government.bar allow
# Optional Discord logs (set, never setr)
set cc_government_webhook_economy "<webhook url>"
set cc_government_webhook_admin "<webhook url>"
set cc_government_webhook_security "<webhook url>"
set cc_government_webhook_bar "<webhook url>"Check: the server console prints one line like cc_government 2.0.0 | treasury city ($0) | society provider esx_society | jobs esx | licences internal | 3 location(s). If it prints config ... lines above it, read them: each one names the setting and what it did.
3. Database
Nothing to do: every table is created on first start. If your database user cannot create tables, run install/sql/install.sql once by hand.
Upgrading from the 1.x city edition? See install/sql/upgrade-from-1x.sql.
4. Jobs (optional)
The government keeps its own roster and works without a framework job. If you want staff and lawyers to have the framework job too (paychecks, duty, other scripts), add the government and lawyer jobs: install/jobs/README.md (in the download). No jobs wanted? Set ServerConfig.Jobs.mode = 'none'.
5. Places
The defaults are the vanilla GTA V City Hall in Rockford Hills. Using a City Hall MLO? Stand where you want each terminal, run /coords (or your framework's equivalent) and paste the values into Config.Locations in config.lua.
Check: walk to the kiosk; you see "City Hall kiosk" on your target (or an [E] prompt).
6. First mayor
/govappoint <your server id>Check: the office terminal opens for you and shows the Levies and Departments tabs.
7. Connect your other scripts
- List your fee scripts in
ServerConfig.Sources(server/config.lua) so they may pay into the treasury, and your department accounts inServerConfig.Departments. - In each fee script call
exports.cc_government:Collect(key, amount, note)after it charged the player, andApplyLevy(key, base)to apply the mayor's levy.
Examples for every export and hook: EXPORTS.md.
8. Something wrong?
TROUBLESHOOTING.md lists every console line and the fix.