Update server.lua

This commit is contained in:
regalonefour
2022-12-15 22:30:42 -05:00
committed by GitHub
parent b2c7c34e15
commit 118219c9aa

View File

@@ -13,6 +13,8 @@ RegisterNetEvent('jim-consumables:server:toggleItem', function(give, item, amoun
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item], "remove", amount or 1)
end
else
if not Config.Consumables[give] then print(('%s may have potentially attempted an item exploit to gain %s %s'):format(src, amount, item)) return end -- cancel if item does not exist in config
if QBCore.Functions.GetPlayer(src).Functions.AddItem(item, amount or 1) then
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item], "add", amount or 1)
end
@@ -31,4 +33,4 @@ RegisterNetEvent('jim-consumables:server:addHunger', function(amount)
if not Player then return end
Player.Functions.SetMetaData('hunger', amount)
TriggerClientEvent('hud:client:UpdateNeeds', source, amount, Player.PlayerData.metadata.thirst)
end)
end)