Update functions.lua

This commit is contained in:
Mustache Dom authored and GitHub committed 2024-10-01 17:41:24 -07:00
1 parent 9b69d6306c
commit 41b66a45e4
1 file changed
+5 -7
+5 -7
View File
@@ -86,7 +86,7 @@ function GetLabels(item)
if inventory == 'qb' then if inventory == 'qb' then
return QBCore.Shared.Items[item].label return QBCore.Shared.Items[item].label
elseif inventory == 'ox' then elseif inventory == 'ox' then
local items = exports.ox_inventory:Items() local items = exports.ox_inventory:Items()
return items[item].label return items[item].label
end end
end end
@@ -102,8 +102,8 @@ function Itemcheck(source, item, amount)
return false return false
end end
elseif inventory == 'ox' then elseif inventory == 'ox' then
local item = ox_inventory:GetItem(source, item, nil, false) local items = exports.ox_inventory:GetItem(source, item, nil, false)
if item.count >= amount then if items.count >= amount then
return true return true
else else
Notifys(source, 'You Need ' .. amount .. ' Of ' .. GetLabels(item) .. ' To Do This', 'error') Notifys(source, 'You Need ' .. amount .. ' Of ' .. GetLabels(item) .. ' To Do This', 'error')
@@ -111,9 +111,7 @@ function Itemcheck(source, item, amount)
end end
end end
end end
RegisterCommand('testitem', function(source)
if not Itemcheck(source,'lockpick', 10) then return end
end)
function GetCoords(source) function GetCoords(source)
local ped = GetPlayerPed(source) local ped = GetPlayerPed(source)
local playerCoords = GetEntityCoords(ped) local playerCoords = GetEntityCoords(ped)
@@ -337,4 +335,4 @@ RegisterServerEvent('md-drugs:server:AddMas', function(data)
if not RemoveItem(src, data.item, 1) then return end if not RemoveItem(src, data.item, 1) then return end
RemoveItem(src, data.xt, 1) RemoveItem(src, data.xt, 1)
AddItem(src, data.recieve, data.amount) AddItem(src, data.recieve, data.amount)
end) end)