ID:148575
 
Ok, this is my Sell verb for the Shopkeeper, but...I have slight prob. It prompts the switch() proc before the variable I had set up even though the variable is set up before the switch() anyone know a possible solution?

Sell()
set category="Communication"
set src in oview(1)
var/list/Sellable = list()
for(var/obj/O in usr.contents)
if(O.worth>0)
Sellable += O
var/obj/P = input("What do you want to sell?","") in Sellable
switch(alert("Do you want to sell [P] for [round(P.worth)]?","Shopkeeper","Yes","No"))
if("Yes")
if(P.worn==1)
usr<<"Not while it's being worn."
else
usr<<"[src]: Thank you, come again."
usr<<"You get §[P.worth]"
usr.zenni+=P.worth
del(P)
if("No")
usr<<"Thank you, come again."
Everything after Sellable += O has to be unindented twice.
In response to Garthor
Thanks, I feel stupid now -_- LOL