Taxi Job
A taxi job with a driver tablet, a live meter, flag-downs, dispatched and player-called fares, depots you build in game, and a reputation ladder.
Requirements
Required
- qbx_core or qb-core. The script finds which one you run.
- ox_lib
- oxmysql
Optional
- ox_target or qb-target to talk to the dispatcher. Without one it's a marker and an E prompt.
- A vehicle keys script, a fuel script and a phone. All found on their own, see Works with.
No SQL to import and no items. The tables create themselves on first start.
Installation
- Drop the
XS-TaxiJobfolder into yourresources. - Add
ensure XS-TaxiJobto yourserver.cfg, after ox_lib, oxmysql, your framework and your keys script. - Give yourself the admin ace, so you can build depots and set pay:
add_ace group.admin xstaxi.admin allow - Restart, go to the Downtown Cab Co. blip and press F6.
The driver tablet
Press F6 or type /cab. On shift it opens anywhere. Off shift it opens at a depot, and anywhere else it sets your GPS to the nearest one. Change the key in Config.Depot.key, or players can rebind it under Settings, Key Bindings, FiveM.
- Calls: player calls on a map, with Accept and Pass.
- Fare: the live meter and the job you're on.
- Shift: sign on and off, the roof lamp, your takings and the depots on a map.
- Earnings, Record, Cabs and the Leaderboard.
A small meter stays on screen while the tablet is closed.
Depots
Depots are built in game. The first one comes from Config.Depot.first the first time the script starts. After that, config.lua isn't read for depots.
- Open the tablet as an admin and go to Depots. Press New depot, or Edit on one.
- Stand where the dispatcher should be and press Dispatcher stands here.
- Park where a cab should appear and press Add a cab bay here. Up to 16 bays.
- Pick the blip icon, colour and size, which cabs it rents, and a job if only that job can sign on there.
- Press Save depot. Every player gets it straight away.
You can close the tablet, walk to the next spot and open it again. Your changes are kept, and markers show where everything is while you edit.
Own cars
Turn on Own cars allowed on a depot and drivers can sign on there in a car registered to them. They have to be in the driver's seat, and it has to be a car (no bikes). There's no deposit.
Ownership is read from player_vehicles. If your garage uses another table, set it in Config.PersonalVehicles.
Pay and rates
Open the tablet as an admin and go to Pay & rates. Everything there is saved and starts on the next fare:
- The meter: flagfall, per km, per minute waiting and the minimum fare
- Night and cross-town bonuses
- The cab deposit, and how much of it a wrecked cab keeps
- How much player calls and own cars pay
- The tip for each star rating
- Each cab's rate and each tier's bonus
An example fare updates as you type. Use config.lua puts the config.lua values back. A ride that's already running keeps the rates it started with, and a driver gets back the deposit they paid.
Phones
Players call a cab from their phone, and drivers get the call on theirs. Found on their own:
- XS-Phone 2.1 or newer: a Call a cab card in the Services app.
- lb-phone: a Taxi app, and messages to the
taxicompany call a cab. - qs-smartphone and qs-smartphone-pro: a Taxi app.
- gksphone: a Taxi app, and messages to the
taxiservice call a cab. - yseries and okokPhone: a Taxi app.
- npwd: call or text 555-8294.
- high-phone, roadphone, 17mov_Phone and qb-phone: call alerts for drivers.
The Taxi app shows how many cabs are free, then who took the call and their plate. Config.Phones sets the app name, the company and the number.
Three ways to get work
Flag-downs. With the roof lamp on, people on the pavement flag the cab down. The one waving gets a flashing blip on your map and a marker over their head, and you're told which side of the road they're on. Pull over and they get in. /lamp turns it off.
Find a fare. Dispatch sends a pickup anywhere on the road network, with a drop-off across town. The passenger is waiting at the kerb when you get there.
Player calls. A player calls from their phone or types /taxi, and every driver with the lamp on gets the call. The first to accept takes it. There's no set destination: the meter runs until you end the ride where they asked to go, from the tablet or with /endride. Passengers cancel with /canceltaxi.
Reputation and cabs
Every fare starts at five stars and loses them for hitting things, flooring it, flipping the cab or hurting the passenger. The stars set the tip and the reputation earned. Five tiers unlock better cabs and raise every fare.
Rented cabs are held against a deposit. Park in a bay at any depot and sign off to get it back, minus damage. Sign off anywhere else and it's gone.
Admin
The admin pages show for anyone with the xstaxi.admin ace. Every action checks the ace again on the server.
- Drivers: who's signed on, their car, fare and takings. Adjust standing, clear a stuck fare, end a shift or wipe a record.
- Dispatch: pause dispatch, turn player calls on or off, and a fare multiplier for events. These reset on restart.
- Pay & rates and Depots: see above.
Works with
- Vehicle keys: qbx_vehiclekeys, Renewed-Vehiclekeys, wasabi_carlock, mk_vehiclekeys, jaksam's vehicles_keys, qs-vehiclekeys, qb-vehiclekeys, cd_garage and okokGarage.
- Fuel: cdn-fuel, ps-fuel, lc_fuel, lj-fuel, qb-fuel, Renewed-Fuel, okokGasStation, ti_fuel, BigDaddy-Fuel, x-fuel, rcore_fuel, qs-fuelstations, ND_Fuel, melons_fuel, LegacyFuel and ox_fuel. Cabs leave the depot full.
- Target: ox_target or qb-target for the dispatcher.
To force one, set its name in Config.Bridges instead of 'auto'.
Troubleshooting
The cab spawns but will not start
Your keys script wasn't detected. Set Config.Bridges.keys to its name instead of 'auto'.
F6 does not open the tablet
Off shift it only opens at a depot, and away from one it sets your GPS to the nearest. If nothing happens at all, another script owns F6: change Config.Depot.key or rebind it under Settings, Key Bindings, FiveM.
There is no Depots or Pay & rates page
Run add_ace group.admin xstaxi.admin allow and reconnect. Both pages are admin only.
Own cars says the car is not registered to you
The plate has to be in player_vehicles under your character. If your garage uses another table or column, set it in Config.PersonalVehicles.
Nobody ever flags me down
Check the roof lamp is on with /lamp. Flag-downs only happen while you're driving with no fare, and only from people at the side of the road ahead of you.
The phone has no Taxi app
Check Config.Phones.app is true. XS-Phone has a Call a cab card in its Services app instead of an app, and npwd uses the number in Config.Phones.number.
Updating
Replace the whole folder and restart. New tables create themselves.
From 1.x: replace config.lua too, since 2.0 adds new settings. Drivers, reputation and fare history stay. Your depot is created from the new config the first time it starts, then you edit it in game.