Installation
1. Requirements
- A FiveM server with OneSync
sv_entityLockdownoff orrelaxedfor networked passengers (withstrict, setConfig.Passengers.Networked = false)- MariaDB or MySQL
ox_lib,oxmysql- One framework:
qbx_core,qb-coreores_extended
2. Files
Place the ns-bus folder in your resources, for example resources/[nullsect]/ns-bus.
3. Start order
ns-bus must start after its dependencies and your framework:
ensure oxmysql
ensure ox_lib
ensure qbx_core # or qb-core / es_extended
ensure ox_target # or qb-target
ensure ns-bus # or: ensure [nullsect]
Vehicle keys, fuel, inventory and dispatch resources may start before or after ns-bus: they are looked up again when they are needed.
4. Database
Nothing to do by default: with Config.Database.AutoMigrate = true the resource creates its tables on first start and applies future updates without touching existing data.
If you prefer to manage the schema yourself, set AutoMigrate = false and import sql/bus.sql. When an update needs a new migration and AutoMigrate is off, the resource stops with a clear console message instead of running on an old schema.
5. Permissions
add_ace group.admin ns-bus.admin allow
add_ace group.admin ns-bus.dev allow
ns-bus.dev only matters when Config.Debug.Commands = true.
6. Check
On start the console shows:
[ns-bus] database migration 1 (core_profiles) applied
...
[ns-bus] database migration 8 (tickets) applied
[ns-bus] ready (framework: qbox, locale: en, schema: v8, vehicle keys: qbx_vehiclekeys)
(one line per migration, 1 to 8, on a fresh database)
The interface (nui/) needs nothing else: its fonts are inside the resource and nothing is loaded from the internet. Servers that want no NUI set every Config.UI option to the ox_lib version.
If you see no supported framework found, the framework is not started before ns-bus or Config.Framework names one that is not running.
7. First steps
- Set your depot in
Config.Depots(desk ped, bus spawns, return point, optional service point);/buscoordscopies your position asvector4(developer command). - Open
/busadmin, create stops where you stand (waiting area, passenger spawns, boarding and exit points, optional inspection point), then build a route from them. - Test the route with a test drive from the admin dashboard, then start a shift at the desk.
8. Keys players should know
| Key | What |
|---|---|
| F6 | Route menu (between routes: the dashboard) |
| 1 / 2 / 3 | Answer a passenger or an officer (only while the card is up) |
| Y / N | Let in / refuse the passenger at the door (only while someone is at the door) |
| K | Ticket machine, on a bus that is on a route (riders buy, the driver offers tickets) |
| Y / N | Pay / decline a ticket the driver offers you (only while the offer is up) |
| E / G | Return the bus / service bay (at the return point or the service point) |
| X | Cancel a service job |
F6, K, 1 / 2 / 3 and Y / N can be rebound in GTA settings (Key Bindings > FiveM); E, G and X are fixed game controls used only at those points. pma-voice uses N for push-to-talk by default: rebind one of them on voice servers.