mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-09-04 17:23:31 +00:00
GetItemByName
This commit is contained in:
+2
-2
@@ -260,7 +260,7 @@ QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items)
|
|||||||
local count = 0
|
local count = 0
|
||||||
for k, v in pairs(items) do
|
for k, v in pairs(items) do
|
||||||
if Player ~= nil then
|
if Player ~= nil then
|
||||||
if Player.Functions.GetItemByName(v) ~= nil then
|
if Player.Functions.GetItemByName(v) > 0 then
|
||||||
count = count + 1
|
count = count + 1
|
||||||
if count == #items then
|
if count == #items then
|
||||||
retval = true
|
retval = true
|
||||||
@@ -270,7 +270,7 @@ QBCore.Functions.CreateCallback('QBCore:HasItem', function(source, cb, items)
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
if Player ~= nil then
|
if Player ~= nil then
|
||||||
if Player.Functions.GetItemByName(items) ~= nil then
|
if Player.Functions.GetItemByName(items) > 0 then
|
||||||
retval = true
|
retval = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user