• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Capacity Problem in inventory otcv8 or tfs 1.x?

Jeyci

Banned User
Joined
May 6, 2023
Messages
289
Solutions
3
Reaction score
36
Hello

As title says i have this Capacity Problem in inventory otcv8 or tfs 1.x. don't know if it's caused by otcv8 or by tfs 1.5
For example in npc trade list it says that i have 40.60 oz of capacity. but in my inventory it shows that i have 4060 of capacity. how to fix this?
thank
Untitled.png
 
I have this code in inventory.lua how do i do in order to make your code work but for 860 protocol?
Lua:
function onFreeCapacityChange(player, freeCapacity)
  if not freeCapacity then return end
  if freeCapacity > 99 then
    freeCapacity = math.floor(freeCapacity * 10) / 10
  end
  if freeCapacity > 999 then
    freeCapacity = math.floor(freeCapacity)
  end
  if freeCapacity > 99999 then
    freeCapacity = math.min(9999, math.floor(freeCapacity/1000)) .. "k"
  end
  capLabel:setText(tr('') .. '\n' .. freeCapacity * 100)
  capLabelMin:setText(tr('') .. '\n' .. freeCapacity * 100)
end
Post automatically merged:

Up!
think i solved the problem had to change

Lua:
capLabel:setText(tr('') .. '\n' .. freeCapacity * 100)
  capLabelMin:setText(tr('') .. '\n' .. freeCapacity * 100)
to
Code:
capLabel:setText(tr('') .. '\n' .. freeCapacity)
  capLabelMin:setText(tr('') .. '\n' .. freeCapacity)
 
Last edited:
Back
Top