if("Sell")
var/v=input("Please select the item you wish to sell.") in list ("Bag","Nevermind")
if(v=="Nevermind")
usr<<"[src]: Quit wasting my time!"
if(v=="Bag")
var/i=input("Which item do you wish to sell?") in usr.contents
set src in usr.contents
this is all i can think of, im stuck from this point. I want the usr to be able to choose an item from their inventory, see how much they can get for it, and be able to sell the item and get gold.
ID:166755
![]() Jun 20 2006, 6:40 am
|
|
![]() Jun 20 2006, 6:51 am
|
|
make a value = [the weapons value here] var for every item and then make the shop give the amount put for the bvalue var the gold they get when they sell it.
|
obj/var/price |
Mysame wrote:
> obj/var/price Yeah, there are a few mistakes you made. mob/shopkeeper/Click() Fixed them. I'm pretty sure that you'll have to make your own list like for() loop through the contents and find all of the /objs and add them to a different list. I think there is a way to make it so you can do something like as type(/obj) but I couldn't get that to work. Anyways, yeah. |
Whoopsie, didn't notice I missed a parent. Anyhow, I never saw much use in using <code>as</code>. :/
And I never added it to a list ... Or I plainly can't remember. Anyhow, it works, normally. o.o |
yay....I got it too work, thx for the example
except for, when you sell, there in the list is also a '' which i'm assuming is the actuall player. How would i get rid of this? |
Mysame wrote:
Normally there ain't something like that.. Then try what Justin said > as obj in null|usr that worked |
The fantom " represents the choice of null since you don't cary a null in your inventory.
Add 'null' to your list and make it called " " like this... as null|anything in usr.contents +"" // Sell anything you've got on you + the Nothing called "" that doesn't show up For more info on the Nothing please see: The Never Ending Story. <^> Asha LaPoe |