Racing scripts for racing fans

There is no link, it looks like these are all the changes, not considering the visual ones that I made

Except that you need to replace all 22 with 23, and 21 with 22 related to the transport classes (in the server and client files) in that order, because the game has a class of racing bolides (this is class 22 - ā€œOpen Wheelā€, you also need to add this class to the html list and the server file lists and client)

Then I suggest adding the automatic teleportation function of the race creator to its beginning when registering this race, so that the creator can join it faster, and other players would simply teleport to him (it is very inconvenient to go to the beginning of the race if it starts at the other end of the map, in order to at least start it to the creator). Or at least add a teleport function to the start of the race (on the panel and in the chat).

In my version of GTA 5, I only have 22 vehicle classes from 0 to 21. Also GetVehicleClassFromName only returns classes from 0 to 21 according to the docs. If you have more, you would need to change all the code that deals with vehicle classes which is spread all over the place.

I know thatā€™s the problem. :frowning:

by the way:

image

I made the 'teleportā€™scripts as a separate resource. It is not incorporated into the ā€˜racesā€™ scripts. Iā€™d like to keep them separate. If people use the teleport scripts they can save and teleport to any race start location they want.

On build 2545 (on which I play) GetVehicleClassFromName returns classes from 0 to 22 (verified). Although yes, according to the doсs, this is not so, but in fact it is different.

oh, okay then, thatā€™s why I didnā€™t notice any changes in the script code about this)

Not worth, I found a bug in the code, since I make all the innovations manually, and the versions are different, thatā€™s why such a bug occurred, I deleted the post, sorry to bother you, everything works as it should, I can later upload my version of the code to github, need it?

I believe you can make a fork of the code and make your own changes on github. If you have suggestions to add/change code, Iā€™m open to it.

I changed the ā€˜Customā€™ vehicle class number from 22 to -1 in the latest version of the scripts. Vehicle classes greater than 21 will need to have the scripts modified to accomodate them.

Hi. I think changing botsā€™ behaviour is a good idea. Iā€™ll give an example: I am playing with friends on the server, and then one of them decides to shoot at me during the race involving 20 bots, and they all immediately start being scared of shots and turn at the next turn, or, for example, my friend decides to make fun of me when I spawn 15 bots, he starts to aim at them, they all leave in different directions, and I have to spawn these bots again. Not convenient at all. It would be nice if you fixed it.

1 Like

Wow, thatā€™s alot of botā€™s you added. Your friend isnā€™t very friendly, haha. Iā€™ve made the AI drivers oblivious to all events so even if they are shot, they wonā€™t flee. If youā€™re curious about being a passenger in one of the AI vehicles, I made it possible for a player to enter the vehicle as a passenger instead of kicking out the driver. Latest version is at the link in the original post.

2 Likes

Why is there no ā€œCustomā€ class in the Vehicle List, you can add it somehow? Also, when entering the command /races lvehicle [-1 or -2] script gives an error. it remains to add a Panel launch button and fix this bug:
image

Bug: teleportation is possible to the car to absolutely any driver, even outside the race, although the idea was that you can sit in the passenger seat only to the spawned bots! Maybe ā€œTaskEnterVehicleā€ and ā€œSetPedVehicleForcedSeatUsageā€ will help somehow

The ā€˜Customā€™ class has its vehicles in a file provided by the server owner. There can be any type of vehicle in it. The file can be named anything. They can use different files for different ā€˜Customā€™ class races. You will not know which file they use ahead of time so you cannot list the vehicles in it. You will only know what vehicles are in the ā€˜Customā€™ class race when the race has been registered. You can see what they are by getting out of any vehicle, walking into the registration point and attempt to join the race. It will list what vehicles are allowed in chat.

1 Like

In order to allow a player to be a passenger, I had to allow this to happen for any vehicle, even outside of a race. If you enter a vehicle with an NPC outside of a race, youā€™ll enter the passenger seat, then kick out the NPC and get in the driver seat. I couldnā€™t figure out how to make this ability specific to the AI vehicles in a race only. Iā€™ll experiment with the functions you mentioned.

1 Like

Thanks!

raceState == STATE_JOINING ā€“ and if you put such a condition somewhere?

Thanks for the explanation I get it