ID:165628
 
How do I make spaces in my inventory? Like having a player only carry 20 items at a time.
What I would do is add a var so any time you add an item to the inventory it would increase by 1, then put something like this in the code
if(usr.holding>=20)
usr<<"You cannot hold more than 20 items at a time!"
return
In response to Muyoine Guyinne
Muyoine Guyinne wrote:
What I would do is add a var so any time you add an item to the inventory it would increase by 1, then put something like this in the code

Wow. That's pretty inefficent. Why don't you just do it like this?
if(src.contents.len>=20)
src<<"You cannot hold more than 20 items at a time."
return
...