ID:177004
 
This is probably an extreemly easy question to answer but i just started today so...
how do u make inventories?
Every obj, mob, turf and atom has a contents list. This list is perfect for inventories, and anywhere you need something to contain other things. By using an object's Move() proc, and Move()ing it to the contents list of another object or mob, you can have the object contained within the contents of the other object or mob. This is all well and good, but you'll need a way for players to view thier own contents list, as well as add and remove things from it. Stat panels have been the standard for viewing inventories, and work wonderfully for this. To setup a new statpanel called Inventory, and having anything in the player's contents list to be displayed in that statpanel, try something like this:

mob/Stat()
statpanel("Inventory", usr.contents)

You'll need two commands to add to, and remove things from the inventory. A standard set of Get and Drop verbs should do the trick:

mob/verb/get(var/obj/O as obj in oview(1))
O.Move(usr.contents)

This tells the game to look for any objects within 1 tile of the usr (oview(1)) and to give the usr the option of placing one of these objects in their inventory by selecting it from a list. The selected object's Move() proc is called, and told to move the object to the usr's contents list, which is displayed using a statpanel.

mob/verb/drop(var/obj/O as obj in usr.conents)
O.Move(usr.loc)

This tells the game to look for any objects within the usr's contents list(var/obj/O in usr.contents), and allow them to select one object from this list to move (O.Move())to the tile they are occupying(usr.loc).

I suggest looking up the Stat() proc for clients, as well as the Move() proc and contents list in the Reference. It may help to read some of the Tutorials, as I'm sure more than one of them covers this topic.

Hope that was helpful!

~X
In response to Xooxer
Thx m8 thats exactly what i needed