mirror of
https://github.com/jimathy/jim-consumables.git
synced 2026-08-19 07:26:04 +01:00
@@ -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)
|
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item], "remove", amount or 1)
|
||||||
end
|
end
|
||||||
else
|
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
|
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)
|
TriggerClientEvent('inventory:client:ItemBox', src, QBCore.Shared.Items[item], "add", amount or 1)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user