Code Monkey home page Code Monkey logo

cw-racingapp's Introduction

CW rework of QB-Racing

⭐ Check out our Tebex store for some cheap scripts ⭐

Images here

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.

Links

⭐ Check out our Tebex store for some cheap scripts ⭐

Support, updates and script previews:

Join The discord!

If you want to support what we do, you can buy us a coffee here:

Buy Us a Coffee

Racing App

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

GPS settings

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.

Track Curation

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

Track Creation

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.

Track Sharing

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!

Automated Races

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.

User Management

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.

Preview 📽

Note: Before new UI was added

YOUTUBE VIDEO

Update to track editor:

Note: Before new UI was added

YOUTUBE VIDEO

UI Update:

YOUTUBE VIDEO

User Management Update:

YOUTUBE VIDEO

UI update 2:

YOUTUBE VIDEO

Ranked, ELO and Crew systems

YOUTUBE VIDEO

Setup

Installation

  1. Download ZIP
  2. Update or insert the database tables. These are found in the cw-racingapp.sql and cw-racingcrews.sql files
  3. Adjust values in the config.lua file to your liking (Hot tip: GO OVER THIS FILE BEFORE REPORTING ISSUES)
  4. 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.'},
  1. Add the item image to your inventory image folder
  2. Create a god user with the command (see below)

Setup Notes

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 in game

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.

Want to change the look?

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.

Updating?

If you're updating from a previous version these might be for you

New User Management - 30th November 2023

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.

VUE update 18th December 2023

See setup section for instructions on how to build a dist

Racing Crews and Racing Rank update 14th February 2024

  1. Make sure to run the sql in cw-racingcrews.sql
  2. Run this in your Database to update your racer_names:
ALTER TABLE racer_names 
ADD COLUMN ranking INT(11) NULL DEFAULT '0';

Dependencies

Images

Track Setup

Track Selection Track Setup

Leaderboards

Interface

Track Creation

You can create tracks from both using an in-game editor or copy/paste a set of checkpoints.

Manage Tracks

Tracks menu

Interface

Handle your race users

Users

Settings

Settings

Uninstalling or full reset

/removeracetracks

Drops the race_tracks table. Use this if you're uninstalling (warning: all tracks and records will be gone)

Developed by Coffeelot#1586, Wuggie#1683

Once upon a time this was a fork of QB-Racing, credits to ItsANoBrainer.

Sponsored Features

Real Time Racing Positions

@JELLYHITAM | Quantum Roleplay Indonesia

Participation Rewards in UI | Extended auth types | Reverse Tracks | Elimination Races

@Rithvikk05 | HTRP

cw-racingapp's People

Contributors

coffeelot avatar itzmuri avatar khatrie avatar krnktv avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.