Fix HasItem check if amount is provided and item not found (#741)

* fix(server/events): amount checking fix

* fix(client/functions): item checking fix
This commit is contained in:
Niunisas
2022-06-30 21:20:45 +03:00
committed by GitHub
parent 82ac1bec32
commit 52cb62c3b2
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -238,7 +238,7 @@ QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items, am
end
else -- Single item as string
local item = Player.Functions.GetItemByName(items)
if item and not amount or (amount and item.amount >= amount) then
if item and not amount or (item and amount and item.amount >= amount) then
retval = true
end
end