ID:262929
 
I've been up for about 2 days strait now so i wouldent be surprised if it was just myown stupidity
but here it goes: I have 2 problems.

The first is this: The sell option won't pop up the list of contents.
mob/NPC
Weapon_Crafter_1
icon = 'Mobs.dmi'
icon_state = "merchant"
char_name = "Metal Crafter"
name = "Metal Crafter"
pvp = "Non-Active"
safe=1
Age = 23
HP = 10
PP = 4196
class = "Metal Crafter"
Click(src in oview(3))
switch(alert("Metal Crafter: Would you like buy or sell?","Metal Crafter","Buy","Sell"))
if ("Buy")
switch(input("Weapon Crafter: What would you like to buy?","Metal Crafter", text) in list ("Samurai's Double Blader.....150y","Toshai's Spear.....200y","Ninja's Nunchuk.....140y"))
if ("Samurai's Double Blader.....150y")
if(usr.yen<150){alert("Metal Crafter: You do not have enough yen")}
else if(usr.class!="Samurai"){usr<<"Metal Crafter: You must be a samurai to puchase this weapon"}
else
var/obj/weapons/Double_Blade/O = new/obj/weapons/Double_Blade(usr)
O.suffix = " Un-Equipped"
usr.yen-=150
usr<<"<font color=aqua>Metal Crafter: Thank you, Come again."
if("Ninja's Nunchuk.....140y")
if(usr.yen<140){alert("Metal Crafter: You do not have enough yen")}
else if(usr.class!="Ninja"){usr<<"Metal Crafter: You must be a ninja to puchase these weapons"}
else
var/obj/weapons/Nunchuk/O = new/obj/weapons/Nunchuk(usr)
O.suffix = " Un-Equipped"
usr.yen-=140
usr<<"<font color=aqua>Metal Crafter: Thank you, Come again."
if("Toshai's Spear.....200y")
if(usr.yen<200){alert("Metal Crafter: You do not have enough yen")}
else if(usr.class!="Toshai"){usr<<"Metal Crafter: You must be a toshai to puchase this weapon"}
else
var/obj/weapons/Spear/O = new/obj/weapons/Spear(usr)
O.suffix = " Un-Equipped"
usr.yen-=200
usr<<"<font color=aqua>Metal Crafter: Thank you, Come again."
if("sell")
for(var/obj/weapons/O in usr.contents)
switch(alert("Metal Crafter: I am willing to give you [O.sellval]y for [O.name], do you still wish to sell?","Metal Crafter","Yes","No"))
if("Yes")
usr.yen += O.sellval
del(O)
usr<<"Metal Crafter: Thank you for your buisness."



Second one is: The give yen button errors when no one else is in the screen.

obj/hud
Give_Yen
layer = MOB_LAYER+21
name = "Give Yen"
icon = 'Tiles.dmi'
icon_state = "giveyen"
screen_loc = "9,15"
Click(mob/M as mob in oview(1))
if(!M.client){usr<<"[M.char_name]: Trust me, I dont need your money."; return}
giveyen = input("How much yen?", "Give yen") as num
if(giveyen >= usr.yen+1){usr<<"You dont have that much yen."}
if(!giveyen){return}
M.yen += giveyen
usr.yen -= giveyen
var/giveyen


Thats about it. Please help, right about now it all looks like jibberish to me.

In the first one, you've got alert("Sell") and an if("sell"). Notice the caps.