mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-09-01 18:58:54 +00:00
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.
This commit is contained in:
+2
-2
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user