XS-Racing
Street racing for Qbox and QBCore. A tablet for street runs and buy-ins, a racing app on the phone for events and championships, and a track studio anyone can build in.
Requirements
ox_libandoxmysql- Qbox (
qbx_core) or QBCore (qb-core)
Everything else is found on its own. The racing app goes on XS-Phone (2.2.0 or newer), lb-phone, qs-smartphone, gksphone, okokPhone or yseries. Without one of those, /racing opens it on screen. screenshot-basic lets racers take photos in game, and your dispatch and vehicle keys scripts are picked up too.
Installation
- Drop
XS-Racinginto your resources and addensure XS-Racingafterox_lib,oxmysqland your framework. - Paste
items/ox_inventory.luaintoox_inventory/data/items.lua, oritems/qb_core.luaintoqb-core/shared/items.lua. - Copy
inventory_images/racing_laptop.pnginto your inventory's image folder. - Give your staff the builder:
add_ace group.admin xs.racing.admin allow. - Restart, then run
/racebuilderin game and build your first track.
The tables are made on first start. There is no SQL to run.
Don't want the item? Set Config.Laptop.requireItem = false and /race opens the tablet for everyone. Config.Laptop.pin = false turns the tablet PIN off.
The tablet
The tablet is the street side. Racers pick a handle and a PIN the first time they open it, and the PIN is asked for every time after that.
- The board: street runs waiting for racers. Join one and your buy-in is held until the race ends.
- Post a run: pick a track, the buy-in, how many cars, a car class, ghosting and whether it's ranked. Private runs stay off the board and open with a code.
- Ladder and crews: ranked results move your rating and earn your crew season points. Seasons reset every 28 days.
- Your card: a photo, a title, a tagline, a colour and a signature ride.
Cops can't host or join street runs, and a street run can tip off the police after the start. Config.Street sets the jobs and the chance.
The racing app
The app is for everyone, no tablet or PIN needed. It goes on the phone by itself, and /racing opens it full screen.
- Tracks: every published track, with ratings, run counts and the record. Practice any of them.
- Events: any racer can book a race up to two weeks ahead. People sign up and get a heads-up when entries open. These are legal races: no police, and the money goes through the bank.
- Cups: championships over several rounds, and head-to-head brackets. The top three split the prize pool and the winner gets a title.
The track studio
Open it from the app, the tablet, or /racebuilder as staff. You build on the real map: grid, start, checkpoints and finish, then props.
- Build the grid for me lines up to 16 cars behind the start.
- Snap to the road moves gates onto the middle of the road.
- Alternate gates make shortcuts, and circuits can have a pit lane that fixes the car.
- 200 props in 12 groups, plus kits like a start area or a cone chicane.
- Edit in the world lets you fly around, grab anything and move it.
- Undo and redo, drafts, and a test drive before you publish.
Any racer can build their own tracks. They can only edit their own, and their props have to stay near their route. Staff verify tracks before they can be ranked. Config.Tracks sets who can build and how many tracks each racer can have.
Car classes
A race can be locked to one car class, like Sports, Muscle, Super or Motorcycles. They come from GTA's own vehicle classes, so there is nothing to set up per car.
The list is Config.Classes. One entry can hold several GTA classes if you want a mixed class, like compacts and coupes together. Boats, aircraft, bicycles and trains can never race.
Troubleshooting
Using the tablet does nothing
On ox_inventory, the client export line is missing from the item. Paste the item from items/ox_inventory.lua as it is.
/race says I need the tablet
The tablet is an item by default. Give yourself racing_laptop, or set Config.Laptop.requireItem to false.
/racebuilder does nothing
You do not have access. Run add_ace group.admin xs.racing.admin allow.
The board is empty
There are no tracks yet, or none are published. Build one with /racebuilder and publish it.
A racer forgot their PIN
Run /racepin with their id or name. They set a new one next time they open the laptop.
The racing app is not on the phone
Your phone is not one the app supports, or it is older than XS-Phone 2.2.0. Use /racing to open it on screen.
I can't join a race
Check the car class on the race. A Sports race only takes Sports cars.
Updating
- Back up the database first.
- Keep a copy of your edited
config.lua. - Replace the resource folder, merge your config back and restart.
Tracks, racers, crews, records and events live in the database, so nothing you built is lost.
Support
Bugs and questions go to the Discord. Include your server's console output — the resource prints the reason when it refuses to do something, and that line is usually the whole answer.