Racing scripts for racing fans

Edit waypoints and save them as a private race. Load saved private races. List private races. Delete private races. Save, load, list and delete public races. Register a race and wait for people to join. Start a race and view results. View 10 best lap times for saved races. Use the NUI interface if you don’t like typing commands. Looking for testers to use these scripts and provide feedback, please.

COMMANDS

/races - display list of available /races commands
/races edit - toggle editing race waypoints
/races clear - clear race waypoints
/races reverse - reverse order of race waypoints
/races load [name] - load race waypoints saved as [name]
/races save [name] - save new race waypoints as [name]
/races overwrite [name] - overwrite existing race waypoints saved as [name]
/races delete [name] - delete race waypoints saved as [name]
/races blt [name] - list 10 best lap times of race saved as [name]
/races list - list saved races
/races loadPublic [name] - load public race waypoints saved as [name]
/races savePublic [name] - save new public race waypoints as [name]
/races overwritePublic [name] - overwrite existing public race waypoints saved as [name]
/races deletePublic [name] - delete public race waypoints saved as [name]
/races bltPublic [name] - list 10 best lap times of public race saved as [name]
/races listPublic - list public saved races
/races register (laps) (DNF timeout) - register your race; (laps) defaults to 1 lap; (DNF timeout) defaults to 120 seconds
/races unregister - unregister your race
/races leave - leave a race that you joined
/races rivals - list competitors in a race that you joined
/races start (delay) - start your registered race; (delay) defaults to 30 seconds
/races results - list latest race results
/races speedo - toggle display of speedometer
/races car (name) - spawn a car; (name) defaults to ‘adder’
/races panel - display command button panel

IF YOU DO NOT WANT TO TYPE CHAT COMMANDS, YOU CAN BRING UP A CLICKABLE INTERFACE BY TYPING /races panel.

SAMPLE RACES

There are six sample races: ‘00’, ‘01’, ‘02’, ‘03’, ‘04’ and ‘05’ saved in the public races list. You can load sample race ‘00’ by typing /races loadPublic 00. To race in the loaded race, you need to register by typing /races register. Go to the registration waypoint of the race indicated by a purple circled star blip on the waypoint map and a purple cylinder checkpoint in the world. When prompted to join, type ‘E’ or press right DPAD to join. Wait for other people to join if you want, then type /races start.

Files and instructions located here: GitHub - emtneutrino/races

7 Likes

Any Showcase (Screenshot/video) ? Looks Cool i will try it out !

1 Like

Unfortunately I don’t have video. FiveM barely runs at 14 fps along with the server running on my VERY underpowered PC. Video capture might decrease fps even more. The video wouldn’t or barely wouldn’t be watchable. I think I can get screenshots. I’ll post them later if I can.

Screenshots

Registration point

Start of race

In race

In race

Near finish

Race results

Editing waypoints in waypoint map

Editing waypoints in world

Command button panel

WiseGuy Fan pepeLaugh

2 Likes

Yeah, I recreated the 3 sample races from nopixel.

1 Like

Added car spawn command:

/races car (name) - spawn a car; (name) defaults to ‘adder’

Added command to list competitors in race player has joined

/races rivals - list competitors in a race that you joined

Not able to save and load races? can anyone help me on this!!asd

Can you post screen shots of any errors in your client F8 console and errors on the server console? Can you tell me what steps you took to cause the problem?

It looks like your messages are appearing on one line instead of separate lines. Does this happen for all your messages?

Added more error messages to narrow down source of errors. Latest version at link in original post.

1 Like

now it shows a error while saving with new files you uploaded, no error in console and f8Capturewqe

I found the error i need to change the name in server side (local raceDataFile = “./resources/races-main/raceData.json”) with same folder name, i didnt noticed it previously and thanks for the script :wink:

The resource contents should be in “./resources/races/”. You should rename “./resources/races-main/” to “./resources/races/”. That way, you don’t need to change the path in races_server.lua. I hope you like it!

1 Like

yep got it, thanks again for the great script :wink:

Newest commands in original post. Newest version at link in original post.

can some tell me what command should I run to save waypoint for a new race? like I run /races edit. now I’m standing on waypoint what command should I run now.
(I tried to run /races save. and error msg appears in the chat “cannot save. race need to have at least w waypoints.”)

You need to have at least two waypoints to save the race. If you are starting with no waypoints, make sure you are in editing mode: When you type ‘/races edit’ it should tell you ‘Editing started’ or ‘Editing stopped’. You want it to tell you ‘Editing started’. Go into the waypoint map and click where you want the start waypoint of your race. Then, click on where you want the finish waypoint. Those are the minimum two waypoints you need. To save those waypoints as a race, type ‘/races save myrace’ to save it as ‘myrace’. Make sure you have the latest version. It is at the link in the original post.

1 Like

Added two more sample races: ‘04’ and ‘05’.