Setrorace - semi-automated race system


Because you deserve better than running races yourself
A highly-compressed video of it in action!

What is it?
Setrorace is a semi-automated race system. You will need to set up the race end, but as long as users in the race are “participants”, they will win automatically upon crossing the finish line.

Features

  • Visual race finish waypoint, sounds, and announcements
  • A countdown!
  • Automatic race winner detection
  • Cheat prevention (freezes cars before the race, and unfreezes as soon as the race starts. Also prevents users from using boosters such as torque boost.)
  • Countdown timer is called server-side, so everyone starts at the same time

Please keep in mind that only race participants will see/be manipulated by some of these features! To participate or force someone to participate, consult the commands below.

Commands
For all:

  • /participate : allows you to participate in a race
  • /optout : opts out of a race if you are participating.

Admin only:

  • /setracefinish : sets the race finish to your position. Optional, but the race system will just tell racers to go to the “end of the map” and you will need to manually end the race with no winner detection.
  • /endrace : force ends a race. not necessary if you have set a race finish.
  • /race : actually starts the race once everyone is set
  • /forcepar playername : forces a user to participate in a race. useful if they’re new and dont know the commands.

Race setup procedure

  1. Go to where the race finish should be, do /setracefinish
  2. The players who wish to race line up and do /participate or you force them to with /forcepar username
  3. You do /race and the race begins, the race ends when someone hits the finish.

Do keep in mind that this was coded on custom maps, so the default roads and GPS are not taken into account nor are they used!
Players will need to navigate with their eyes. It shouldn’t be hard to call upon a native to draw a route but I haven’t tried it (yet?).

Help!
Did you read the topic in its entirety? Because this system has a bit to it. If not, please read. If you have and still have questions, please state the exact, entire error you are receiving.
I’ve tested this a lot on my server but have stripped away a bit of code because it is not relevant for others. So please don’t hesitate to let me know that something is up.

Download:
Setrorace.zip (3.8 KB)

8 Likes

great one but how can i add check points and laps ? just give me a hint

That would require a complete rework of this system, especially for the checkpoints.
The laps may be easier but you would need to change the race end function to only execute when you reach the number of laps, and count each time the racer passes through it if it’s not there yet, I guess.

Please upload it to github, k thanks. Cool concept and script.

Video would be great

bro there is a video

why tho? i could but i don’t see why. all the source code is visible in this download in Lua and you can post issues here.

Just wait until a fivem moderator tells you to upload it to github.

“Whenever possible, make use of the file upload feature on the forum.”
uh?

Or on github.

Yes, but it is not a requirement, and the rules say to use the file upload unless it’s necessary to upload it elsewhere or if you want to use github. Which I don’t want because there’s no point.

For me personally, and many others. Github is a bettter choice. I would like to see it on github.

great scripy but very simmiler to [Release] StreetRaces - Multiplayer Races with Checkpoints, HUD and more [v1.00] !!!

Ah, that resource is pretty good. No shame if people prefer that over mine.

when i count the race everyone can watch it how can i fix it for limited people can see the count