Esx Addonaccount/society Item count 0

Hey there,

Does an yone know how to delete the items in the list when they are 0 ?

Cause even if i take out all the items from the inventory (EMs Frige for example), the label still remains and write

  • 0x Water

You can be the one that saves me some sleep :wink:

Thanks for the help mates :wink:

You could have provided more details, but ok.

I guess that you are usign esx menu for this “inventory” thing.
Simply check if item count is bigger than zero, if so insert it to the elements table.

Other solution is to stop saving items with 0 count into database, which I recommend much more.

2 Likes

@antond1 Thank you for your answer :wink:

How can I do that ? (Not saving items with 0 count in Db ? :p)

My LUA is really poor, so i could make some changes but not evrything.
Anyway, your help is really appreciated :wink:

For not Saving 0x item into to esx menu “inventory” do this

check for :
local elements = {}
for i=1, #inventory.items, 1 do

    local item = inventory.items[i]

    if item.count > 0 then  --  < add this  code line!!.... not the (--)
      table.insert(elements, {label = .... etc etc etc }
   end      -- < Dont forget to close the if :) 

emd

1 Like