Merge pull request #2 from Chxttr/patch-1

Fix Item Does not Exit being broadcasted globally
This commit is contained in:
QBCore Framework
2021-04-04 15:41:54 -05:00
committed by GitHub
+2 -2
View File
@@ -237,7 +237,7 @@ QBCore.Player.CreatePlayer = function(PlayerData)
self.Functions.AddItem = function(item, amount, slot, info)
local totalWeight = QBCore.Player.GetTotalWeight(self.PlayerData.items)
local itemInfo = QBCore.Shared.Items[item:lower()]
if itemInfo == nil then TriggerClientEvent('QBCore:Notify', -1, "Item Does Not Exist", "error") return end
if itemInfo == nil then TriggerClientEvent('QBCore:Notify', source, "Item Does Not Exist", "error") return end
local amount = tonumber(amount)
local slot = tonumber(slot) ~= nil and tonumber(slot) or QBCore.Player.GetFirstSlotByItem(self.PlayerData.items, item)
if itemInfo["type"] == "weapon" and info == nil then
@@ -558,4 +558,4 @@ end
QBCore.EscapeSqli = function(str)
local replacements = { ['"'] = '\\"', ["'"] = "\\'" }
return str:gsub( "['\"]", replacements ) -- or string.gsub( source, "['\"]", replacements )
end
end