ID:268097
 
Click()
if(t=="Buy")
var/tt=input("What would you like to [t]?","Choose an item in list.") as null|anything in list("Cancel","Food")
if(isnull(tt)) return
if(!usr || !usr.client) return
if(tt=="Cancel")
usr<<"Thanks for coming to Hairy Lary's marketplace!"
return
var/ttd=tt
if(tt=="Food")
tt="fo"
var/ttt=input("How much [ttd] do you want to [t]?","Going rate is [vars["market[tt]"]] per [ttd].") as null|num
if(isnull(ttt) || !usr.client) return
if(!usr || !usr.client) return
var/tttt=ttt*vars["market[tt]"]
var/answer=input("it'll cost [tttt] for [ttt] [ttd], are you sure?","Are you sure?") as null|anything in list("Yes","No")
if(isnull(answer)) return
if(!usr || !usr.client) return
if(answer=="Yes")
if(ttt<=0)
return
if(usr.money<tttt)
usr<<"Sorry you don't have enough money, come back again when you do!"
return
if(usr.money>=tttt)
usr.vars["tt"]+=ttt
usr.money-=tttt
usr<<"Thank you for your purchase of [ttt] [ttd] at a cost of [tttt]!!!"
return
else
return


is it ok doing this?

I do it because vars[] allows me to EASILY edit something...

but I'm not sure if there's problems that will arise by using it?