qbcore-framework / qb-target

A better interaction system for FiveM
GNU General Public License v3.0
94 stars 239 forks source link

[SUPPORT] QB-Shops not Working With QB-target #139

Closed Supreme69X closed 2 years ago

Supreme69X commented 2 years ago

RegisterNetEvent('qb-shops:247clerk', function() local PlayerPed = PlayerPedId() local PlayerPos = GetEntityCoords(PlayerPed) for shop, in pairs(Config.Locations) do local position = Config.Locations[shop]["coords"] local products = Config.Locations[shop].products for , loc in pairs(position) do local dist = #(PlayerPos - vector3(loc["x"], loc["y"], loc["z"])) if dist < 3 then local ShopItems = {} ShopItems.items = {} QBCore.Functions.TriggerCallback("qb-shops:server:getLicenseStatus", function(hasLicense, hasLicenseItem) ShopItems.label = Config.Locations[shop]["label"] if Config.Locations[shop].products == Config.Products["weapons"] then if hasLicense and hasLicenseItem then ShopItems.items = SetupItems(shop) QBCore.Functions.Notify(Lang:t("success.dealer_verify"), "success") Wait(500) else for i = 1, #products do if not products[i].requiredJob then if not products[i].requiresLicense then ShopItems.items[#ShopItems.items + 1] = products[i] end else for i2 = 1, #products[i].requiredJob do if QBCore.Functions.GetPlayerData().job.name == products[i].requiredJob[i2] and not products[i].requiresLicense then ShopItems.items[#ShopItems.items + 1] = products[i] end end end end QBCore.Functions.Notify(Lang:t("error.dealer_decline"), "error") Wait(500) QBCore.Functions.Notify(Lang:t("error.talkcop"), "error") Wait(1000) end else ShopItems.items = SetupItems(shop) end for k, v in pairs(ShopItems.items) do ShopItems.items[k].slot = k end ShopItems.slots = 30 TriggerServerEvent("inventory:server:OpenInventory", "shop", "Itemshop" .. shop, ShopItems) end) end end end end)

Added This And removed the Marker And Gett Errors Screenshot 2022-06-17 163138

BerkieBb commented 2 years ago

Not a qb-target issue, that is an issue with your qb-shops config