Its possible make a stack inventory like dayZ or Resident Evil 4?

I’m trying to make an inventory system but I can’t imagine how to do this efficiently, does anyone who’s ever mecheu with this have any tips on how to do it?

Examples:
dayz-inv-av-1-en-1050