Racing scripts for racing fans

The radius size of the checkpoint is directly related to the proximity. The bigger the radius the bigger the proximity.

yea, and that’s the issue. but it’s cool. i’m using the old version with the proximity, i was just hoping to get the latest version with what works for me.

If you want to make it so that the racer activates the next checkpoint outside of the radius of the checkpoint, you can do that like the following:

At line 1999 in races_client.lua in the current version you can increase the ‘proximity’ by adding a value to waypointCoord.r in the comparison below.

if #(pedCoord - vector3(waypointCoord.x, waypointCoord.y, waypointCoord.z)) < waypointCoord.r + 10.0 then

I’ve added 10.0 to waypointCoord.r in the comparison above so that if the racer is waypointCoord.r + 10.0 from the center of the checkpoint, the next checkpoint is activated. Change 10.0 to whatever value you want.

2 Likes

Thank you very much. this fixed my issue.

Cool. I’m glad I finally figured out what you wanted to do and was able to help you.

1 Like

Fixed my issue also, having a lot of fun with the new version but the checkpoint on the default races was so close to the center. In the old version, just had to come within a car length of the checkpoint to trigger it. Or maybe I changed that in the old source, Now if I can get it to work with this money system, I will be super happy. Thank you for all your hard work! It is a very fun system.

fyi this money system will be completely rewritten today. And updated tomorrow :slight_smile:

1 Like

Created a few more race tracks, exported them here for others to import and use.
Edit: Now 17 tracks
Edit: Now 18-Magellen added
Edit: also added these:
19-Voodoo
20-Loop
21-Occupation
22-Rat --canals and alleys
and 23-Harmony8 which is a huge figure eight around the isle.
24-Piers - a point to point track that is reversable

1 Like

All the funds related functions: GetFunds, SetFunds, Withdraw and Deposit are in port.lua. You just need to port them to the other money system. They should be self explanatory. The Remove function basically deletes the player’s bank account, but can just be an empty function (like in the ESX port) if you don’t need it.

1 Like

Would it be possible to implement a tier list system similar to the class restrictions?

For example, we have an array of addon vehicles and virtually all of them are in the super class, but I wouldn’t want a Bugatti Veyron being able to join the same race as a VW Golf.

It would be amazing if we could create text files that have allowed vehicle names i.e. A_Tier.txt, S_Tier.txt and use that to create races, rather than the GTA defined classes?

Sure. It shouldn’t be too hard to implement. I’ll probably implement it as an extra class race that includes vehicles from a specified text file.

1 Like

I’ve added a custom class race that includes vehicles from a specified file in the latest version. To use it, you need to create a race of type “class” and use 22 (Custom) as the class. You will also need to specify the file in which permitted vehicles are listed. Racers can view permitted vehicles by getting out of any vehicle they are in, walking into the registration point and attempting to join the race. The chat window will display the list of permitted vehicles. Details are in the README.md file.

1 Like

Hi, this works great thanks! I commented out the functions to spawn vehicles and open the panel so that it can’t be abused (on an RP server) but cannot approve a player ID for creating the races.

I enabled the local requirePermission = true in races_server.lua, and requested racing premission in game, but when using races approve 1 in my server command it states invalid player ID. I also noticed that there isn’t a roles.json file in the current GitHub files and wasn’t sure if this file is automatically created or is missing?

Thanks again for your work, I’m very new to GTA modding so it’s all a bit baffling :stuck_out_tongue:

Did you type “races listReqs” in the server console to verify you were player ID 1? Also check the console on the server and client for errors. If you can provide pictures of what you did, that would help, too. When you set requirePermission = true, anyone who doesn’t have permission will only see the restricted button panel. See the screen shots for the restricted panel. They won’t be able to create and register races. If you commented out the spawn command, then they won’t be able to spawn vehicles using the restricted panel either. The “roles.json” file gets created after giving permission to someone.
Thanks for testing!

1 Like

Hi, thanks for the fast response!

I have included 2 screenshots (1 of in game, 1 of txAdmin) but I would do /races request ingame followed by races listReqs in the server panel and then races approve 1. I receive approve: Invalid player ID. as the server repsonse.

I’m not sure why it’s not working in your case. Maybe there is a conflict with another resource? Have you tried to approve other people? Are you using a special version of the server instead of the default? I’ll make a change to the races_server.lua script with some debug code. Could you test it again when I put the new version up?

Might be a conflict, the only other mods loaded are ESX, some vehicles, vMenu and the vehicle debug mod. I’ll look into their scripts and see if I can spot any conflicts. Server version is FXServer-master SERVER v1.0.0.5282 win32. I’ll get a friend to hop on and try giving them permissions tomorrow too and let you know if the changes worked :slight_smile:

Edit: Just had them hop on and was receiving same error trying to give them permissions

I just added some debug code in the approve function. Could you test that again and show the results?
Thanks

Hi I receive:
[ script:races] approve: Invalid player ID: 1
[ script:races] 0
[ script:races] steam ID here (not comfortable posting on a forum)
[ script:races] NaclTea

Using GetPlayerName in the approve and deny functions to verify if the playerID is valid. Latest version at link in original post.

1 Like