Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Doesnt show vehicles in the garage app #138

Open
Bornke opened this issue Jul 31, 2023 · 6 comments
Open

Doesnt show vehicles in the garage app #138

Bornke opened this issue Jul 31, 2023 · 6 comments

Comments

@Bornke
Copy link

Bornke commented Jul 31, 2023

image

@amsali22
Copy link

how many vehicles you have ?

@noswear922
Copy link

same i have 5-6 cars

@urdemize304
Copy link

i replaced it with old part of the code and it works now for me. lines 45-104 of @qb-phone/server/garage
also now shows my registration for them

@HypnoticGD
Copy link

HypnoticGD commented Nov 20, 2023

Maby this can help you

`QBCore.Functions.CreateCallback('qb-phone:server:GetGarageVehicles', function(source, cb)
local Player = QBCore.Functions.GetPlayer(source)
local Vehicles = {}
local vehdata
local result = exports.oxmysql:executeSync('SELECT * FROM player_vehicles WHERE citizenid = ?', {Player.PlayerData.citizenid})

if result[1] then
    for _, v in pairs(result) do
        local VehicleData = QBCore.Shared.Vehicles[v.vehicle]
        local VehicleGarage = "None"
        local enginePercent = round(v.engine / 10, 0)
        local bodyPercent = round(v.body / 10, 0)
        
        if v.garage then
            if Config and Config.Garages and Config.Garages[v.garage] then
                VehicleGarage = Config.Garages[v.garage]["label"]
            else
                VehicleGarage = v.garage
            end
        end -- Hier war die Änderung: Ende des if-Blocks für v.garage

        local VehicleState = "In"
        if v.state == 0 then
            VehicleState = "Out"
        elseif v.state == 2 then
            VehicleState = "Impounded"
        end
        
        if VehicleData["brand"] then
            vehdata = {
                fullname = VehicleData["brand"] .. " " .. VehicleData["name"],
                brand = VehicleData["brand"],
                model = VehicleData["name"],
                plate = v.plate,
                garage = VehicleGarage,
                state = VehicleState,
                fuel = v.fuel,
                engine = enginePercent,
                body = bodyPercent,
                paymentsleft = v.paymentsleft
            }
        else
            vehdata = {
                fullname = VehicleData["name"],
                brand = VehicleData["name"],
                model = VehicleData["name"],
                plate = v.plate,
                garage = VehicleGarage,
                state = VehicleState,
                fuel = v.fuel,
                engine = enginePercent,
                body = bodyPercent,
                paymentsleft = v.paymentsleft
            }
        end
        Vehicles[#Vehicles+1] = vehdata
    end
    cb(Vehicles)
else
    cb(nil)
end

end)`

that end) needs to be copied aswell for it to work

@Fohes
Copy link

Fohes commented Nov 29, 2023

Unfortunately, this still hasn't solved the no vehicles in my phone issues.

@Maxhero54
Copy link

image

Garage comes with an error and dosent show any vehicle #134

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants