legacy-towing
Installation
Dependencies and setup steps.
Installation
Dependencies
Start these before legacy-towing:
PolyZone— used for rig deck zones (client/rigs.luabuilds aPolyZone:newper rig model).legacy-lib— suppliesGetAccentColor()/GetAccentGradient()for theming the admin NUI.ox_lib— used throughout forlib.callback,lib.notify,lib.showTextUI/hideTextUI,lib.progressBar,lib.raycast,lib.addCommand,lib.requestModel.ox_target— every interactable option (ramps, load/unload, winch, hitch prompts, release) is registered through it.
Server setup
- Drop the resource into your resources folder and add
ensure legacy-towing(after PolyZone, legacy-lib, ox_lib, ox_target) in your server.cfg. - Grant the admin ace to whoever should be able to author rigs:
add_ace group.admin admin allowConfig.AdminAcedefaults to'admin'— this must be an ace, not a principal.Config.CommandRestriction(default'group.admin') is the principal the/towingconfigcommand itself is restricted to. - The resource creates/reads
data/rigs.json(and keeps a rollingdata/rigs.backup.json) — no manual setup is needed, but back this file up before making bulk edits, since only one backup generation is kept.
Building the admin NUI
The admin config panel is a separate React/Vite/Tailwind app under web/. It must be built before the resource is packaged/deployed:
cd web/
npm install
npm run build
This produces web/dist, which the resource's ui_page points at. If you edit anything under web/src you must re-run npm run build or the NUI will keep serving stale assets. npm run dev (port 3011) and npm run preview are available for local iteration but do not connect to live game state.
Web dependencies (informational only — not part of the Lua dependency list)
- react ^18.3.1, react-dom ^18.3.1
- @fortawesome/fontawesome-svg-core ^7.1.0, @fortawesome/free-solid-svg-icons ^7.1.0, @fortawesome/react-fontawesome ^3.1.1
- vite ^6.0.3 (dev), @vitejs/plugin-react ^4.3.4 (dev)
- tailwindcss ^3.4.16 (dev), postcss ^8.4.49 (dev), autoprefixer ^10.4.20 (dev)
Authoring rigs
Once running, an admin (with the ace above) runs /towingconfig (or whatever Config.AdminCommand is set to) near a trailer/flatbed to draw its deck, place slots/ramps/winch anchors, and save. Saving replaces data/rigs.json and pushes the new config to every connected client.