ID:266284
 
how would is so this?
King of Wind wrote:
how would is so this?


mob
Stat()
..()
statpanel("inventory",contents)

mob/verb/Add_Item()
usr.contents+=new/obj/Item

obj/Item
icon='item.dmi'



That was a example of how to do it.
In response to Nadrew
i am not that gret at coding and i ask how do u make it so that when u click something it makes u buy stuff and i was wondering if you use an iput format (like at Login()) or would you use the basic usr<< output?
In response to King of Wind
King of Wind wrote:
i am not that gret at coding and i ask how do u make it so that when u click something it makes u buy stuff and i was wondering if you use an iput format (like at Login()) or would you use the basic usr<< output?



You would have to use the switch proc there are two ways of using it:

Way one:

mob/Shopkeeper()
var/Items = input("What do you want?")in list("Item 1","Item 2"))
Click()
switch(Items)
if("Item 1")
usr<<"You picked Item 1!!"
if("Item 2")
usr<<"You picked Item 2!!"


Way two:
mob/Shopkeeper
Click()
switch(input("What item")in list("Item 1","Item 2"))
if("Item 1")
usr<<"You picked Item 1!!"
if("Item 2")
usr<<"You picked Item 2!!"


These both do the same thing.
In response to Nadrew
it is not workin
In response to King of Wind
King of Wind wrote:
it is not workin


I never said that exact code would work it was a example of how to use the switch proc with input()

I suggest you write the code for yourself.
In response to Nadrew
it says proc definition not allowed inside another proc