fix(qs-inventory): pcall pe handleDeleteItem qs-smartphone-pro
Export-ul handleDeleteItem nu există în versiunea curentă de qs-smartphone-pro. Wrappat cu pcall pe liniile 84, 117, 154 din RemoveItem.lua ca să nu mai blocheze equip/unequip de haine.
This commit is contained in:
@@ -81,7 +81,7 @@ function RemoveItem(source, item, amount, slot, metadata, disableAutoShowBox)
|
||||
for _, _slot in pairs(slots) do
|
||||
if inventory[_slot].amount > amountToRemove then
|
||||
if SmartphoneMetadata then
|
||||
exports['qs-smartphone-pro']:handleDeleteItem(source, inventory[_slot])
|
||||
pcall(function() exports['qs-smartphone-pro']:handleDeleteItem(source, inventory[_slot]) end)
|
||||
end
|
||||
TriggerEvent('esx:onRemoveInventoryItem', source, item, amount)
|
||||
TriggerClientEvent('esx:removeInventoryItem', source, item, amount)
|
||||
@@ -114,7 +114,7 @@ function RemoveItem(source, item, amount, slot, metadata, disableAutoShowBox)
|
||||
return true
|
||||
elseif inventory[_slot].amount == amountToRemove then
|
||||
if SmartphoneMetadata then
|
||||
exports['qs-smartphone-pro']:handleDeleteItem(source, inventory[_slot])
|
||||
pcall(function() exports['qs-smartphone-pro']:handleDeleteItem(source, inventory[_slot]) end)
|
||||
end
|
||||
TriggerEvent('esx:onRemoveInventoryItem', source, item, amount)
|
||||
TriggerClientEvent('esx:removeInventoryItem', source, item, amount)
|
||||
@@ -151,7 +151,7 @@ function RemoveItem(source, item, amount, slot, metadata, disableAutoShowBox)
|
||||
inventory[_slot].amount = _quantity
|
||||
SetInventoryItems(source, inventory[_slot].name, _quantity)
|
||||
if SmartphoneMetadata then
|
||||
exports['qs-smartphone-pro']:handleDeleteItem(source, inventory[_slot])
|
||||
pcall(function() exports['qs-smartphone-pro']:handleDeleteItem(source, inventory[_slot]) end)
|
||||
end
|
||||
|
||||
if not ContainsItem(itemsToCheck, item) then
|
||||
|
||||
Reference in New Issue
Block a user