#Car tuning lost

1 messages · Page 1 of 1 (latest)

rich terrace
#

Script Name: qb-vehicles/qb-garages/qb-mechanic

Error: The cars lose all modifications, meaning they come out of the garage in their original form. It doesn't happen often, but it does happen. And it's particularly annoying for players. When they put money into tuning and the car comes out of the garage as a standard model.

Has this ever happened to you? And do you have any idea what the problem could be?

And actually it does not matter if its a car spawned by admin (and taken as admincar, or a purchased car from vehicleshop)

What's the issue your experiencing: Tuned car comes out of the garage in its original condition.

What was the last thing that changed: This happened to me at the beginning when I started with qb-core and didn't change, add or modify any scripts.

What measures and steps have you taken to troubleshoot this issue: Actually no idea what the cause of this problem is. Maybe it could be a database problem. But I really have no Idea.

Video/screenshot: X

#

Car tuning lost

jaunty knoll
rich terrace
rich terrace
vapid crypt
#

Same issue here also

native spoke
#

same here

#

anyone got an fix?

#

this started happening for me when i created the newest qbcore recipe before that on older version worked fine

#

does not matter what tuning script im using tried rcore tuning then qb customs

#

i'm trying to change the core to a little older version and will let you all know if it fixed the problem

native spoke
#

other older 1.2,6 qbcore version is working fine the tuning stays and does not go away

#

so the problem is with the newest 1.2.6 core updates

rich terrace
#

maybe a solution:

Look at qb-garages:client:takeOutGarage

Under the SetVehicleEngineOn

Add
QBCore.Functions.SetVehicleProperties(veh, properties)

native spoke
#

its something with core not the qb-garages i think

#

i even tried the old qb-garages

#

still was the same

rich terrace
quaint patrol
#

@rich terrace what happens with the tests 😄 , here with me same issue

#

it is sometimes not all the time

quaint patrol
rich terrace
ebon junco
quaint patrol
#

@rich terrace try removing CheckPlate

#

Function from there

ebon junco
#

nah don't remove it i'll give you my fix instead :
try this

local function CheckPlate(vehicle, plateToSet)
    local vehiclePlate = promise.new()
    CreateThread(function()
        local timeout = 1000  -- 1 second max wait
        while timeout > 0 do
            Wait(500)
            if GetVehicleNumberPlateText(vehicle) == plateToSet then
                vehiclePlate:resolve(true)
                return
            else
                SetVehicleNumberPlateText(vehicle, plateToSet)
            end
            timeout = timeout - 500
        end
        vehiclePlate:resolve(false) -- Resolve false if timeout
    end)
    return vehiclePlate
end
rich terrace
rich terrace
ebon junco
glossy arch
# ebon junco Replace the whole checkplate function

local function CheckPlate(vehicle, plateToSet)
local vehiclePlate = promise.new()
CreateThread(function()
while true do
Wait(500)
if GetVehicleNumberPlateText(vehicle) == plateToSet then
vehiclePlate:resolve(true)
return
else
SetVehicleNumberPlateText(vehicle, plateToSet)
end
end
end)
return vehiclePlate
end
I am already looping it and it still happens for me I will try your way but I dont see much gains from it.

ebon junco
#

Just try 🤷‍♂️

glossy arch
#

I will give it a shot

rich terrace
#

2 players have reported that their own vehicles have disappeared when they are a little far away from their car

cunning moat
#

Vehicles are not natively persistent.

rich terrace
quaint patrol
ebon junco
# quaint patrol Did it fixed?

For me it works. I don’t have any issues taking out vehicles without mods or different plates. 🤷🏿‍♂️

Now if that guy didn’t come back that means it worked for them also im assuming

rich terrace
#

But I hope it lasts. So we can label this Post as solved.

quaint patrol
#

If there are 5 of them at the garage chance to appear 80%

ebon junco
#

Are they all trying to take the car at the same time? Or just 5 players around the point?

quaint patrol
#

Everytime it’s different but from what i see, mostly happens like that

quaint patrol
#

@rich terrace any problems

#

after that fix ?

rich terrace
# quaint patrol <@921845604542451753> any problems

I don't know if it has anything to do with these changes. But there have been a few cases where some players have been unable to take their items out of the trunk.

But the problem with the tuning disappearing is not happening at the moment.

quaint patrol
#

@rich terrace the trunk has nothing to do with that problem. The trunk is from your inventory script

#

Insterresting that the dissapear stopped with you

#

@ebon junco (sorry 4 tag), did you managed to test with more players?

#

same garage spot

rich terrace
ebon junco
quaint patrol
quaint patrol
#

@ebon junco tested , not working wth a lot of players, from 10 players 1 will have the problem , the easyiest fix for this is making more cooldown on spawn and add 2 times the tunning if its not added add an second add properties after 5 seconds to be sure it is here

#

and it will work 1000 %

ebon junco
#

I’ve tested on my live server and don’t have that problem. My only issue is that it stacks the cars on top of each other so i gotta fix that.

glossy arch
#

We found the root cause of it to be fair. The entity ownership does not belong to the player that pulls out the vehicle when he is applying the mods. What we are doing now is we are waiting till the ownership transfers over to whoever owns the car before applying the mods. I want to confirm on 100% there is no bugs and we could send the code over to qbcore to add it so its fixed for everyone in future.

quaint patrol
glossy arch
#

I just wanted to make sure it works and clean it up but here is the client side

#

server side

rich terrace
glossy arch
#

The client i send is just the takeout garage the server i send the whole thing as i cba sending every event separate but you will have to edit it we have logger there thats written by us and it wount work for you

glossy arch
#

comment it out

#

or delete the lines

fair furnace
#

THANKS

quaint patrol
#

@glossy arch tell us whats the version of the qb-garages you use

#

because the code is verry different than that one in the latest github repo

glossy arch
#

2.0.0

fair furnace