mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-31 02:08:55 +00:00
Merge pull request #8 from Sylundef/master
Avoid getting more item than possible
This commit is contained in:
+2
-1
@@ -324,8 +324,9 @@ AddEventHandler('esx_mecanojob:putStockItems', function(itemName, count)
|
||||
TriggerEvent('esx_addoninventory:getSharedInventory', 'society_mecano', function(inventory)
|
||||
|
||||
local item = inventory.getItem(itemName)
|
||||
local playerItemCount = xPlayer.getInventoryItem(itemName).count
|
||||
|
||||
if item.count >= 0 then
|
||||
if item.count >= 0 and count <= playerItemCount then
|
||||
xPlayer.removeInventoryItem(itemName, count)
|
||||
inventory.addItem(itemName, count)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user