fleexcl/qb-racing

Standalone racing script for qb-core

★ 0Forks 0GitHub ↗Compare

README

QBCore Racing

Original code converted, tied up, slightly rewritten, and features added from qb-lapraces.

I really liked the qb-lapraces, but I wanted a standalone version that did not require qb-phone, as well as some custom features so here it is!

QB-Racing lets you manage your racing scene in a better way using items and custom racer names instead of player names! There are two items involved, the master racing fob, and the basic racing fob. At the moment, these are created using the createracingfob command by a qb-core admin, but you can implement any system you want. When created, the fob is bound to the citizenid it was created for, and has a racer name attached to it. Only the citizenid created for it can use it. Using the fob brings up the racing options menu (examples below) which is where you do all the interacting with the script. Each fob has an entry in the Config to tune it to your server to allow or deny certain usage abilities (listed below). By default the master racing fob is required to CREATE new race tracks, and both dongles allow you to do everything else.

Config Options per Dongle:

  • Join a race
  • View race records
  • Setup a new race
  • Create a new race track

Setup

  1. Update or insert the database table. Instructions are found in the racing.sql file a. Updating from qb-lapraces must follow OPTION 1 to update their database table and preserve their race tracks b. NOT updating from qb-lapraces must follow OPTION 2 to create the database table
  2. Adjust values in the config.lua file to your likings
  3. Add the items to your qb-core/shared/items.lua
['fob_racing_basic'] = {['name'] = 'fob_racing_basic', ['label'] = 'Basic Racing Fob', ['weight'] = 500, ['type'] = 'item', ['image'] = 'fob_racing_basic.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['description'] = 'This basic fob allows someone to join custom races.'},
['fob_racing_master'] = {['name'] = 'fob_racing_master', ['label'] = 'Master Racing Fob', ['weight'] = 500, ['type'] = 'item', ['image'] = 'fob_racing_master.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['description'] = 'This master fob allows someone to create custom races.'},
  1. Add the item images to your inventory image folder

Dependencies

Features

  • 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
  • Locale Support
  • Create Custom Races Tracks

Example Usage

Interface Examples

Interface

Video Example

Creating a Race

Video Example

Race Interface, Joining a Race, Finishing a Race

Video Example

Change Log

1.02

  • Use item hotfix
  • Added InfoBox on inventory item add for createracingfob

1.0

  • Initial release

Future ToDos

  • Ability to delete race tracks ingame

Other Creations

License

QB Racing
Copyright (C) 2022

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>

Contributors

ItsANoBrainerboppescripting

Issues