qbcore-framework / qb-garages

Garage System Used With QB-Core :car:
GNU General Public License v3.0
48 stars 260 forks source link

[BUG] Vehicles pulling out as AI plates/default sometimes? #285

Closed nzkfc closed 1 year ago

nzkfc commented 1 year ago

Describe the bug Player pulls a car, it spawns the model but default and with an AI plate e.g. ABCD1234 (we use ABC 123 plates from OkOKvehicleshop)

To Reproduce Steps to reproduce the behavior:

  1. Pull a car, sometimes it won't pull the right car, then sets the players car in DB as state 0 so they have to go to tow yard to get it out.

Expected behavior Car should pull always

Screenshots N/A

Questions (please complete the following information):

Additional context Add any other context about the problem here.

nzkfc commented 1 year ago

Managed to re-create it myself, except my car came out with correct plates, just said I had no keys, managed to re-create 5 times in a row and then it finally came out ok:

https://i.imgur.com/vBdIicJ.png

nzkfc commented 1 year ago

Was on this car btw: https://i.imgur.com/8NpE1oF.png

local function doCarDamage(currentVehicle, veh)
    local engine = veh.engine + 0.0
    local body = veh.body + 0.0

    if Config.VisuallyDamageCars then
        local data = json.decode(veh.mods)

        for k, v in pairs(data.doorStatus) do
            if v then
                SetVehicleDoorBroken(currentVehicle, tonumber(k), true)
            end
        end
        for k, v in pairs(data.tireBurstState) do
            if v then
                SetVehicleTyreBurst(currentVehicle, tonumber(k), true)
            end
        end
        for k, v in pairs(data.windowStatus) do
            if not v then
                SmashVehicleWindow(currentVehicle, tonumber(k))
            end
        end
    end
    SetVehicleEngineHealth(currentVehicle, engine)
    SetVehicleBodyHealth(currentVehicle, body)
end

The line is for k, v in pairs(data.doorStatus) do

Glen92 commented 1 year ago

hmm this explains why i dont have the keys to this vehicle sometimes. Did you find a fix for this?

nzkfc commented 1 year ago

Nah, I really can't see why, it's almost like the sql was slow, but then you guys are having issues too, I asked on discord support too but was promptly told its another script but we have nothing that calls for mods via sql or vehicle keys or affects those events from being triggered.

I've only had this issue since the qb-garages update before current, only updated due to gksphone being dependant on it.

On Thu, 27 Apr 2023, 8:48 pm Glen Klijn, @.***> wrote:

hmm this explains why i dont have the keys to this vehicle sometimes. Did you find a fix for this?

— Reply to this email directly, view it on GitHub https://github.com/qbcore-framework/qb-garages/issues/285#issuecomment-1525157670, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGHUHNXPC422RZCHBTWDQLXDIXEVANCNFSM6AAAAAAXBDSFPI . You are receiving this because you authored the thread.Message ID: @.***>

eygi commented 1 year ago

you guys already fixed this bug? having the same issue

nzkfc commented 1 year ago

Nope, becoming a big pain though and I can't roll back because gksphone needs this version

On Sat, 13 May 2023, 2:31 am eygi, @.***> wrote:

you guys already fixed this bug? having the same issue

— Reply to this email directly, view it on GitHub https://github.com/qbcore-framework/qb-garages/issues/285#issuecomment-1545839627, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGHUHJO6E4Q5JLNFQOFY3TXFZCVDANCNFSM6AAAAAAXBDSFPI . You are receiving this because you authored the thread.Message ID: @.***>

d-w00d commented 1 year ago

https://gyazo.com/fc663c12c4c11052e13a549c7b1abff5 Same issue. Even on a older version of QB-GARAGES

nzkfc commented 1 year ago

Yep I even got banned from Quasar scripts because I made a ticket telling them latest was broken with their code lel.

Sharkiiie commented 1 year ago

Can you provide some steps to reproduce this? I vaguely remember having issues with the spawnveh cb when using the incorrect setfuel export.

d-w00d commented 1 year ago

I just know its on random, You can have a garage full of vehicles and at random they won't have keys or some will persistently have no keys.

d-w00d commented 1 year ago

local function doCarDamage(currentVehicle, veh) local engine = veh.engine + 0.0 local body = veh.body + 0.0

if Config.VisuallyDamageCars then
    local data = json.decode(veh.mods)

    for k, v in pairs(data.doorStatus) do
        if v then
            SetVehicleDoorBroken(currentVehicle, tonumber(k), true)
        end
    end
    for k, v in pairs(data.tireBurstState) do
        if v then
            SetVehicleTyreBurst(currentVehicle, tonumber(k), true)
        end
    end
    for k, v in pairs(data.windowStatus) do
        if not v then
            SmashVehicleWindow(currentVehicle, tonumber(k))
        end
    end
end
SetVehicleEngineHealth(currentVehicle, engine)
SetVehicleBodyHealth(currentVehicle, body)

end

QBCore Function Client ? Maybe something is broken between the two? if props.doorStatus then for doorIndex, breakDoor in pairs(props.doorStatus) do if breakDoor then SetVehicleDoorBroken(vehicle, tonumber(doorIndex), true) end end end

d-w00d commented 1 year ago

Deff dont see this being fixed anytime soon =/

github-actions[bot] commented 1 year ago

This issue has had 60 days of inactivity & will close within 7 days