qbcore-framework / qb-garages

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

[BUG] - After adding the /addgarage to house and owned the house when I park the car it works until restart , after restart when I pull car out then try to park it again it says "This vehicle cant be stored". #352

Closed isaadamirr closed 1 month ago

isaadamirr commented 6 months ago

Describe the bug After adding the /addgarage to house and owned the house when I park the car it works until restart , after restart when I pull car out then try to park it again it says "This vehicle cant be stored".

To Reproduce

Expected behavior Car should be parked at the garage all the time when I park car any time at the added garage.

Screenshots Please find the video link here: https://tinyurl.com/yrfbdgmy image_2024-03-03_044943571

Questions (please complete the following information):

c-drive commented 5 months ago

+1

JokerDom commented 5 months ago
if type == 'house' and not exports['qb-houses']:hasKey(Player.PlayerData.license, Player.PlayerData.citizenid, Config.Garages[garage].houseName) then
    cb(true)
else
    cb(false)
end

I changed the code in the server/main.lua to this and it seems to be working

isaadamirr commented 5 months ago
if type == 'house' and not exports['qb-houses']:hasKey(Player.PlayerData.license, Player.PlayerData.citizenid, Config.Garages[garage].houseName) then
    cb(true)
else
    cb(false)
end

I changed the code in the server/main.lua to this and it seems to be working

Code seems will work for the house garage but it still won't be working with other garages, please confirm if this should be working with other garages as well?

JokerDom commented 5 months ago

Cancels out all other garages when using that code. Only house garages will work.

HoaNgocTram commented 3 months ago

Cancels out all other garages when using that code. Only house garages will work.

if type == 'house' and exports['qb-houses']:hasKey(Player.PlayerData.license, Player.PlayerData.citizenid, Config.Garages[garage].houseName) then
        cb(false)
        return
    end

Replace with this you can use all public garages and houses garage

github-actions[bot] commented 1 month ago

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