qbcore-redm-framework / qbr-shops

Shops for RedM QBCore
GNU General Public License v3.0
0 stars 13 forks source link

Error while accessing the weapon shop #4

Closed RexShack closed 2 years ago

RexShack commented 2 years ago

fresh build using the latest recipe, when accessing the weapon shop Screenshot 2022-04-13 073230

OGReaperx commented 2 years ago

There is no licenses anymore in the db at all, and the shops just haven’t been updated to have those removed, waiting on this to be fixed

centrdev commented 2 years ago

hope it gets resoveld soon

RexShack commented 2 years ago

@centrdev temporary fix while they work it out is replace this on client.lua

RegisterNetEvent('qbr-shops:openshop')
AddEventHandler('qbr-shops:openshop', function(shopType, shopName)
    local type = shopType
    local shop = shopName
    local ShopItems = {}
    ShopItems.items = {}
    exports['qbr-core']:TriggerCallback('qbr-shops:server:getLicenseStatus', function(result)
        ShopItems.label = shop
        if type == "weapon" then
            if result then
                ShopItems.items =  Config.Products[type]
            else
                for i = 1, #Config.Products[type] do
                    if not Config.Products[type][i].requiresLicense then
                        table.insert(ShopItems.items, Config.Products[type][i])
                    end
                end
            end
        else
            ShopItems.items = Config.Products[type]
        end
        ShopItems.slots = 30
        TriggerServerEvent("inventory:server:OpenInventory", "shop", "Itemshop_"..type, ShopItems) --Review later for visual correction
    end)
end)

with this

RegisterNetEvent('qbr-shops:openshop')
AddEventHandler('qbr-shops:openshop', function(shopType, shopName)
    local type = shopType
    local shop = shopName
    local ShopItems = {}
    ShopItems.items = {}
    ShopItems.label = shop
    ShopItems.items = Config.Products[type]
    ShopItems.slots = 30
    TriggerServerEvent("inventory:server:OpenInventory", "shop", "Itemshop_"..type, ShopItems) --Review later for visual correction
end)
centrdev commented 2 years ago

awesome, that did it

ansljeremy commented 2 years ago

Resolved in https://github.com/qbcore-redm-framework/qbr-core/pull/26