Hmm, maybe checking against bag size, like:
Code:
local function getBagCount()
for i=1, 4 do
if GetContainerNumSlots(i) == 0 then
return i-1
end
end
return i
end
Just thinking if it is possible to have a free slot between two bags - then this method wouldn't work, but then you'd need to fetch their actual id's and not just the count.
Where do you need it?