CW rework of QB-Racing
⭐ Check out our Tebex store for some cheap scripts ⭐
Some of the added features:
- Integration with cw-performance to create class based racing
- ELO system for ranking racers
- Crew system
- Elimination races (last to cross finish line on lap gets eliminated)
- Advanced leaderboard for each track and class showing everyones best times
- By-class leaderboard
- Replacement of tire-piles lamps
- Increased size of checkpoints
- Not as harsh checkpoint-pass detection compared to qb-racing
- Remove race tracks you have created
- See your position in the race
- Real time positioning (can be toggled off if performance issue)
- Updated HUD
- Accurate time (old one would vary depending on computer performance) NOW IN MS!
- Ability to reset/run the SQL scripts from in game
- Phasing/Ghosting of racers
- Ability to lock tracks down to people by citizen ID
- Support for Renewed Crypto
- Participation payouts
- Post race leaderboard
- Custom UI
- Track curation
- Ability to select Racing HUD position (see HUDSettings in Config file)
Original features by ItsANoBrainer:
- Standalone racing script not requiring qb-phone to utilize
- Items to immerse your racing scene with Racer Names
- Config options to adjust item permissions to your liking
- Config options to adjust different options
- (Limited) Locale Support
- Create Custom Races Tracks
Do note, this script has TWO systems for participation money. Make sure to check the readme and read the comments regarding these and how to use them.
As of update posted on 1st July -23, racer names are unique. The max limit is by default 3 but can be set individually. If you want to remove names from DB without openign it up, an admin can use
/remracename <racerName>
As of update posted on 26th August -23 we will no longer support qb-menu usage.
⭐ Check out our Tebex store for some cheap scripts ⭐
Options:
- Join a race
- View race records
- Setup a new race
- Create a new race track
- Modify old tracks
- List your own tracks
- Manage racer users (for master and god rank users)
- Create and manage crews
At the bottom left corner there's a cog wheel. Clicking this brings up the options menu (more stuff to come). But here you can toggle using the GPS route and the style of it.
Our idea with this feature is to allow admins to flag a track as "DONE". The track can no longer be edited. Additional features of curated tracks might be only allowing participation money to be paid out on those tracks, for example.
Currently you can only curate/uncurate a track via admin command: /racingappcurated "<race-id>" true/false
QUOTATION MARKS AROUND RACE ID IS IMPORTANT
The key to this script working is making GOOD tracks. If you're trying to do 200 checkpoint style races with checkpoints randomly thrown around the map, this is not the script for you. There is a max checkpoint variable in the config that will warn users when they reached the level. Some PCs might struggle with different lower/higher amounts tho, so keep that in mind.
- Avoid placing checkpoints on/under/near bridges/overpasses.
- GTA GPS can't handle opposite-directions on roads: Place checkpoints on the correct side of the road
- Intersections can be tricky for the GPS. We advice to not put checkpoints in the middle of them, but before or after, in the correct lane.
- Alleys can cause issues. Use with caution.
- The script spawns 2 entities + 1 emitter for EVERY checkpoint. If you have 100 checkpoints that might just crash peoples games.
You can grab the checkpoints from either My Tracks tab in game, by using the copy button or directly from the database entry and then pasting to something like https://pastebin.com/ There's an import function (if enabled in config) in the Create Track tab to import via paste.
Hop into the CW Discord and share some tracks in the racingapp-tracks channel!
The script offers automated races. You can set these up in the config (Config.AutomatedRaces
, Config.AutomatedOptions
). If any of these are commented out/removed the automation will not start.
The Automation will, at random, try to grab one of the tracks from the Config.AutomatedRaces
table at the interval of what you set in Config.AutomatedOptions.timeBetweenRaces
, by default this is 20 minutes. The races start after 5 minutes of popping up.
The script offers user management now. We've moved away from the basic/master fob and instead users are saved in the database. To swap your user, open the racingapp and press the cog-icon to open the settings. To create users you can either buy a user account from a trader/laptop (if this is enabled in the config) or have someone create one for you.
The tiers are racer < creator < master < god and are defined as follows:
racer = {
join = true, -- join races
records = true, -- see records
setup = true, -- setup races
create = false, -- create races
control = false, -- control users
controlAll = false, -- control all users
}
...
join means you can join races
records means you can access records
setup means you can set up races
create means you can create tracks
control means you can manage users you create
controllAll allows you to control all users, and also permanently delete users
Basically, any racer name/user created by another player will be tied to them. So if person X buys an account from player Y, player Y can also revoke player Xs account via the in game menus, as long as player Y has a user with the control authorization.
The easiest way. Just use the Racing GPS that's included in the script.
If you want to open racingapp from another script you can use the exports
Client side:
exports['cw-racingapp']:openRacingApp()
Server side:
exports['cw-racingapp']:openRacingApp(source)
Update to track editor:
- Download ZIP
- Update or insert the database tables. These are found in the
cw-racingapp.sql
andcw-racingcrews.sql
files - Adjust values in the
config.lua
file to your liking (Hot tip: GO OVER THIS FILE BEFORE REPORTING ISSUES) - Add the item to your
qb-core/shared/items.lua
['racing_gps'] = {['name'] = 'racing_gps', ['label'] = 'Racing GPS', ['weight'] = 500, ['type'] = 'item', ['image'] = 'racing_gps.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['description'] = 'Wroom wroom.'},
- Add the item image to your inventory image folder
- Create a god user with the command (see below)
You only need both this resource and cw-performance.
Depending on how you're setting it up, you might want to spawn yourself a racingapp item and create an account. This can be done in 4 ways: Via the trader or laptop (See respetive config option for more info), the racingapp ui (requires an already existing account - BY DEFAULT THIS ALSO REQUIRES A JOB. SEE LAPTOP CONFIG SETTINGS) or the command.
Use the command createracinguser
to do this. For example:
/createracinguser god 1 IReadTheReadme
This will create a god account for the user with serverID 1 (probably you if you're on your dev server) called IReadTheReadme.
Spawn the item racing_gps
normally and use it.
Some users have reported this not working and throwing an error. It seems this is related to Core issues. The order of the input might differ for some cores for some reason. The server side printout should help you determine the order. Just type it in according to that instead.
RacingApp is built in VUE, this means you can't just edit the files directly. This requires some more know-how than just developing with basic html/js. You can find out more information in this Boilerplate Repo.
If you're updating from a previous version these might be for you
You need to update one of your database tables. Run this:
ALTER TABLE racer_names
ADD COLUMN auth TEXT DEFAULT 'racer',
ADD COLUMN createdby TEXT,
ADD COLUMN revoked TINYINT DEFAULT 0;
You also need to change out the old GPS/fob items to the new one, see setup section. You might also want to read up on the new system, see User Management section.
See setup section for instructions on how to build a dist
- Make sure to run the sql in
cw-racingcrews.sql
- Run this in your Database to update your
racer_names
:
ALTER TABLE racer_names
ADD COLUMN ranking INT(11) NULL DEFAULT '0';
Track Setup
Leaderboards
Track Creation
You can create tracks from both using an in-game editor or copy/paste a set of checkpoints.
Manage Tracks
Handle your race users
Settings
Drops the race_tracks
table. Use this if you're uninstalling (warning: all tracks and records will be gone)
Once upon a time this was a fork of QB-Racing, credits to ItsANoBrainer.
@JELLYHITAM | Quantum Roleplay Indonesia
@Rithvikk05 | HTRP