From 217b7fdbe8a7a84fa8924851f63933c1ca947a5b Mon Sep 17 00:00:00 2001 From: Ben Sherman Date: Tue, 5 Jun 2018 20:18:00 +0200 Subject: [PATCH] Duplication fix Simply fixed is so that it prevents players from storing items in a negative amount. Storing a certain item as -1 and go to take it out and place whatever amount you want and boom you got unlimited amount of said item. --- server/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/main.lua b/server/main.lua index 052c1092..369af723 100644 --- a/server/main.lua +++ b/server/main.lua @@ -347,7 +347,7 @@ AddEventHandler('esx_property:putItem', function(owner, type, item, count) local playerItemCount = xPlayer.getInventoryItem(item).count - if playerItemCount >= count then + if playerItemCount >= count and count > 0 then TriggerEvent('esx_addoninventory:getInventory', 'property', xPlayerOwner.identifier, function(inventory) xPlayer.removeInventoryItem(item, count) @@ -365,7 +365,7 @@ AddEventHandler('esx_property:putItem', function(owner, type, item, count) local playerAccountMoney = xPlayer.getAccount(item).money - if playerAccountMoney >= count then + if playerAccountMoney >= count and count > 0 then xPlayer.removeAccountMoney(item, count)