[SUPPORT] QB-Shops not Working With QB-target
Supreme69X opened this issue · 1 comments
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.talk_cop"), "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)
Not a qb-target issue, that is an issue with your qb-shops config