mirror of
https://github.com/jimathy/jim-consumables.git
synced 2026-08-17 06:26:03 +01:00
Update server.lua
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user