My question: Lets say I have bread set to stack at a maximum of 10. How do I stop it from going into another inventory slot? Currently You can hold a full inventory of 10stacks of bread. I want the ONE STACK to be the only stack you can carry of that specific item, AKA Some sort of check to make sure you don’t have that item in an inventory slot already.
Negative, I’m still using ‘limit’
But if I have 5 empty inventory slots. I can fill them all with stacks of bread. I want it to only allow 1 stack of an item in my inventory. So i don’t have 5 stacks of bread taking up 5 inventory slots.
And for some reason, I can’t give items at all. Is the disc_inventory_itemdata used at all? Mine is 100% emprty at the moment.
For anyone getting null in there database in the file server\inventory.lua
Line 508 to 521 replace with this
function saveInventories()
for type, inventories in pairs(loadedInventories) do
for identifier, inventory in pairs(inventories) do
if inventory ~= nil then
if table.length(inventory) > 0 then
saveLoadedInventory(identifier, type, inventory)
else
deleteInventory(identifier, type)
end
end
end
end
RconPrint('[Disc-InventoryHud][SAVED] All Inventories' .. "\n")
end
and line 523 to 547 replace with this
function saveLoadedInventory(identifier, type, data)
if table.length(data) > 0 then
MySQL.Async.execute('UPDATE disc_inventory SET data = @data WHERE owner = @owner AND type = @type', {
['@owner'] = identifier,
['@type'] = type,
['@data'] = json.encode(data)
}, function(result)
if result == 0 then
createInventory(identifier, type, data)
end
loadedInventories[type][identifier] = nil
TriggerEvent('disc-inventoryhud:savedInventory', identifier, type, data)
end)
end
end
this will fix the problem with null in the database.
We can buy unlimited items, but offcourse they got lost if the inventory is full. Is there any way to implement the max. inventory items with esx-kr-advanced-shops?
ok so your problem with esx_skin the setmax weight
which version of es_extended are you using?
if you are using the latest one then you need the version just before that because this inventory does not support the latest esx yet with the weight system heres a link to the version you need.