Racing scripts for racing fans

Still running into trucks, argh. At least the Froggers are having fun.

Added the old LS Underground map as 29-Empire to my list of exported maps for this Racing Script set.

Did some code cleanup, bug fixing. Working on documentation. Added random race options:
‘recur’ = {yes, no}
‘order’ = {yes, no}

When ‘recur’ is yes, the same vehicle in the vehicle list can appear in later laps. When ‘recur’ is no, a vehicle that was used in a previous lap will be removed from the vehicle list. Note that multiple vehicles of the same model can appear more than once in a vehicle list, so it is possible for the same vehicle model to reappear. If you don’t want the same vehicle model to reappear in later laps, put only one of that model in the vehicle list.

When ‘order’ is no, everyone’s vehicles may be different on the same lap. For example, one player may have an ‘adder’ after their first lap while another player may have a ‘banshee2’ after their first lap. When ‘order’ is yes, everyone will have the same vehicle on the same lap. For example, everyone will have an ‘adder’ after the first lap, ‘elegy2’ after the second lap, ‘zentorno’ after the third lap, etc.

Working on documentation before release.

I have problem with saving races, typing command /races save pub i’m ending with this nottification. What can i do?



Can you post pictures of your F8 console on the client and also the console of the server when you receive these errors?

on F8 0 error (1 screenshot). Console with this error but my server is on esx and i didnt change port to esx (2 screenshot). If i change it in console says this (3,4 screenshot). On local host all basic non esx or QB, working god no errors and everyfing working.




It looks like you need to create a new port to ESX that complies with today’s standards, as the ESX getSharedObjects feature is no longer supported. I don’t understand these other errors, so I won’t comment

1 Like

Try the following first, and if it doesn’t work, I will ask you to try another thing in a different post.

First, add the following to your fxmanifest.lua file:

shared_script '@es_extended/imports.lua'

In the ESX port of the port.lua file that you are using instead of the original port.lua file, do the following:
Delete the line:

local ESX = nil

Delete the following lines:

Citizen.CreateThread(function()
    while nil == ESX do
        TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
        Citizen.Wait(0)
    end
end)

Restart your server and try saving the track again. Let me know if it works and if it doesn’t, tell me exactly what steps you took when following the above instructions and post any errors on the F8 client console and the server console.

1 Like

I did exactly what you wrote above. I replaced the ports and followed your instructions. I reset the server, it did not show any errors when saving the route under F8 and the server console, saving routes works (Screenshot 1), but a new error appeared, which was also there before. I’m trying to join a race and an error pops up in the server console but not in F8 and I can’t join the race (screenshot 2). The error also pops up when I enter the server (screenshot 3)



Add the following to the top of the esx version of the port.lua file that I asked you to modify:

ESX = exports["es_extended"]:getSharedObject()

Let me know if it works this time and if not, please post any errors in the F8 client console and the server console.

Now everything works. We are now testing all the functions of the script and I will let you know if anything else doesn’t work. If you want, I can send you all the lines from port.lua to update on github.

Cool. You don’t have to send me your port.lua file. I know what to change. Thanks for testing things. I appreciate it. I’ve been working on some changes to the code and will release the new code soon, hopefully.

When I turn on the server, an error pops up (screenshot 1) I have to restart the script then it works normally and no errors appear

Make sure the following code is above all the functions in port.lua. I think that’s why you’re seeing that error.

ESX = exports["es_extended"]:getSharedObject()

EDIT: It shouldn’t matter where this line is as long as it is outside of any functions so what I said above shouldn’t matter.

EDIT: I think it does matter where it’s located, so the above edit is probably wrong.

1 Like

Does the chat command /races funds give the same error? I’m not sure why you’re getting that error. Actually, it shouldn’t matter where the ESX initilization is as long as it is outside of all the other functions.

EDIT: I think it does matter where it is placed, so the ESX initialization probably needs to be above all the other code.

An error appears if I do not restart the script. After restart it works normally

So if you restart the server, the error appears, but after you restart the script, the error disappears?

Exactly, I think it’s because when the server starts there is no one on the server and it can’t read the data until the script is restarted. Error appears when i join to serwer (Screenshot 1)

I haven’t been able to reproduce this error. Can you post your fxmanifest.lua file and your port.lua file?