Fix items in separate slot not being recognized

This commit is contained in:
BerkieBb
2021-08-27 18:55:05 +02:00
committed by GitHub
parent 9a2ec19673
commit b069f71fcc
+3 -3
View File
@@ -257,7 +257,7 @@ QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items, am
for i, _ in pairs(items) do
if i then finalcount = finalcount + 1 end
end
local item = Player.Functions.GetItemByName(k)
local item = Player.Functions.GetItemsByName(k)
if item ~= nil then
if item.amount >= v then
count = count + 1
@@ -268,7 +268,7 @@ QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items, am
end
else
finalcount = #items
local item = Player.Functions.GetItemByName(v)
local item = Player.Functions.GetItemsByName(v)
if item ~= nil then
if amount ~= nil then
if item.amount >= amount then
@@ -287,7 +287,7 @@ QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items, am
end
end
else
local item = Player.Functions.GetItemByName(items)
local item = Player.Functions.GetItemsByName(items)
if item ~= nil then
if amount ~= nil then
if item.amount >= amount then