#cw-racing app race creater bug

1 messages Β· Page 1 of 1 (latest)

wind estuary
#

I set up the racing app every thing works but when I go to make a create a race I get this error in the server console
[ script:cw-racingapp] SCRIPT ERROR: @cw-racingapp/server/main.lua:1273: attempt to index a nil value (field '?')
[ script:cw-racingapp] > IsPermissioned (@cw-racingapp/server/main.lua:1273)
[ script:cw-racingapp] > ? (@cw-racingapp/server/main.lua:1369)
[ script:cw-racingapp] > handler (@cw-racingapp/server/functions.lua:11)
[ script:cw-racingapp] > rawQuery (@oxmysql/dist/build.js:26467)
[ script:cw-racingapp] > processTicksAndRejections (node:internal/process/task_queues:96)

I did not change anything other then the config stuff and the only thing that I found to fix it was by making both calls look like this not sure if maybe the sql is not pulling the create thing it needs or not even tho I have god not sure what else it could be.

RegisterServerCallback('cw-racingapp:server:isAuthorizedToCreateRaces', function(source, TrackName)
return { nameAvailable = IsNameAvailable(TrackName) }
end)

RegisterNetEvent('cw-racingapp:server:createLapRace', function(RaceName, RacerName, Checkpoints)

    if IsNameAvailable(RaceName) then
        TriggerClientEvent('cw-racingapp:client:startRaceEditor', source, RaceName, RacerName, nil, Checkpoints)
    else
        TriggerClientEvent('cw-racingapp:client:notify', source, Lang("race_name_exists"), 'error')
    end

end)

left shale
#

fixing

wind estuary
#

Thank you

left shale
#

Fixed. Patch pushed. Release made ok_nice

wind estuary
#

Thank you so much!

tropic hollow
#

After update

left shale
#

It looks like its trying to find a user in your db that doesn't exist

#

which shouldn't happen cause you can't even access the race creation without it hmmHD

tropic hollow
#

yes it exists

#

and has the correct group

left shale
#

Did you run the sql required for the update?

tropic hollow
#

oh okay

#

my bad then

tropic hollow
#

after sql update and ofc script update

left shale
#

There seems to be a debug print lacking

#

Is it outside of the cropped screenshot?

tropic hollow
#

what the..

#

i legit just downloaded the latest update

#

and i don't have that

#

i think i confused the files

#

gimme 2 mins

left shale
#

You should replace ALL files πŸ‘

tropic hollow
#

i did, i am so confused

#

lol

#

very confusional, i will re-download

#

oh lol, i was downloading from the release page

#

my bad

left shale
#

Maybe I forgot to do a release lol

#

Nah, it's there in latest release

#

Maybe you accidentally got the previous one

#

haha

tropic hollow
#

prolly :/

#

i will test and let you know

#

after update

#

the error overlap the print i guess

left shale
#

Ah this migt happen if no user is active

#

You're 100% sure you got active and crew in the racer_names table?

tropic hollow
#

i ran the latest sql

left shale
#

Which one?

#

cause I posted 2

tropic hollow
left shale
#

Ah good good

#

Does it work now?

tropic hollow
#

in the files

#

negative

left shale
#

Negative as in it doesnt work or negative in "it works but it threw an error"

tropic hollow
#

It throws the error and it doesn't work

#

that error it's shown as soon i try to click "Confirm"

#

to be more clear

left shale
#

Absolutely no idea why this is happening

#

but I'll change some shit up and hope it fixes it I guess

#

Pushed some changes

#

no idea if it will fix this

#

you'll have to grab the source tho, not release

tropic hollow
#

the issue seem to be here still:
return Config.Permissions[auth][type]

left shale
#

Did you really grab the latest source?

tropic hollow
#

oh wait, forgot to return the result

#

not really, doing this my way ig

#

since the issue seemd to be in the fetch from db

left shale
#

I changed that wit hthe latest push

tropic hollow
#

weird, i'll try the upd

#

Yessirrr

left shale
#

No idea why it wouldn't work before but I guess that fixes it shrug

tropic hollow
#

XD

left shale
#

worked perfectly for me

#

what core you using?

tropic hollow
#

esx

#

:/&

left shale
#

thats probably why then πŸ’€

tropic hollow
#

ahahaha

#

can i ask 1 more thing in this thread to avoid opening another one?

left shale
#

sure

tropic hollow
#

i saw how you handle the user cross the checkpoint

#

but that's area based not checkpoint cross

left shale
#

There isn't really any "crossing" a checkpoint

tropic hollow
#

your not doing this type of stuff

left shale
#

in fivem

#

If I was checking one pixel line crossing people wouldn't be passing checkpoints if the game hitches

tropic hollow
#

and this makes a lot of sense

left shale
#

simpler, and cheaper on performance to check distance

tropic hollow
#

but my question is, by changing the value here: Config.CheckpointBuffer, nothing happens :/

left shale
#

The checkpoint buffer is increased space outside of the checkpoint edge

#

Think of the checkpoint as a circle, and when you're in it you're passing it

tropic hollow
#

i know, i added a marker draw the other day

#

but this is the side of how much the circle will expand?

#

outside of the checkpoint points?

left shale
#

blue is buffer zone

#

and obviously same direction in all directions from the center of the checkpoint

tropic hollow
#

this is what i mean

left shale
#

Yeah buffer zone wouuld decrease the distance you need to be from the center of that circle

tropic hollow
left shale
#

Buffer is basically a way to make it so checkpoints are larger than they appear

#

so they arent missed by just getting close

tropic hollow
#

yes, but even if i set that the 0 for example, there is no changes

left shale
#

are you using the correct value to make the draw?

tropic hollow
#

because for us, it's okay the current handling via circle, the issue it's that people can "skip" the checkpoint by just going outside of it

#
DrawMarker(1, data.coords.x, data.coords.y, data.coords.z - 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, MaxDistance * 2, MaxDistance * 2, 2.0, 255, 0, 0, 150, false, true, 2, false, nil, nil, false)

left shale
#

then make the buffer smaller?

tropic hollow
#

it's set to 0.0

left shale
#

weird

#

cant see anywhere else in the code where it'd be adding anything

#

Just give it a negative buffer then

#

should fix it

tropic hollow
#

okay, seem to work fine now

#

with a negative

#

still a bit outside on bigger ones

#

i sent you a dm with a snippet code

left shale
#

I think I found why

#

It makes little sense why it'd display like it those tho cause it would be doing double the size

#

but it's clearly not double the size πŸ€”

tropic hollow
#

check that lil snippet i sent ya

left shale
#

Seems to add a lot of calculations

#

Pushed a fix that checks correctly to the center πŸ‘

tropic hollow
tropic hollow
tropic hollow
#

but still, if you can manage to check that from point a to point b (the prop) would be better, because people can just slide cross the checkpoint and cut to the next one

#

and that's the main issue

left shale
#

You can't go outside the checkpoint size with the new version I made

#

our outside the size + buffer zone that is

tropic hollow
#

we checked the last upd

#

working as wanted, ur the best boss

tropic hollow
left shale
#

There's no option to do that, no

tropic hollow
#

did it myself, if you want to push that

tropic hollow
#

hi boss

#

another thing i noticed

#

this remains after the race end

#

my issue or an general issue?

left shale
#

I'm unable to replicate this issue

left shale
#

I am reworking the track display system tho, so I haven't tested on the old variant

#

fyi @tropic hollow

fallow frigate
#

Okey so small mystery, I'm trying to create races with a french keyboard, (azerty), but I toggled it in qwerty just to be sure, it seems that the keys for making the checkpoint size are [ and ], and even if I'm typing in qwerty rn (I do have those keys) I can only make the checkpoint shorter but not bigger, anyone ever had that issue or any idea what could be making that happen ? πŸ‘€ (no error whatsoever in the console)