A little annoyance with a verb in Developer Help
|
|
ok i have a verb, whats bugging me is when i click on 'rifles' it goes to instead the equipment bit asking to buy kevlar and stuff, this is annoying, heres the verb
mob/verb/Buy() if(usr.buy==1) var/c = input ("What category?") in list ("clips","rifles","equipment") switch(c) if("clips") if(usr.gp>=35) if(usr.clips>=3) return else usr<<"You buy a clip!" usr.clips+=1 usr.gp-=35 else if(usr.gp<=0) usr<<"You dont have any cash to spend on this!" else usr<<"You dont have enough money to buy this, you have [usr.gp] and you need 35 cash!" else if("equipment") var/k = input ("what will you buy?") in list ("kevlar","kev+helm") switch(k) if("kevlar") if(usr.gp>=650) if(usr.kev==0) usr.Health+=25 usr.gp-=650 usr.kev=1 else usr<<"You allready have armour!" else if(usr.gp<=0) usr<<"You dont have any cash to spend on this!" else else if("kev+helm") if(usr.gp>=1000) if(usr.kev==0) usr.Health+=30 usr.gp-=1000 usr.kev=1 else usr<<"You allready have armour!" else if(usr.gp<=0) usr<<"You dont have any cash to spend on this!" else usr<<"You dont have enough money to buy this, you have [usr.gp] and you need 1000 cash!" else if("rifles") if(usr.team=="blue") var/l = input ("What kind of weapon would you like to buy?") in list ("colt","none") switch(l) if("colt") if(usr.gp>=3500) view(3) << 'm4a1_deploy.wav' usr.gp-=3500 usr<<"You buy a colt!" usr.clips=0 usr.max=30 usr.lbullets=30 else if(usr.team=="red") var/l = input ("What kind of weapon would you like to buy?") in list ("ak-47","none") switch(l) if("ak-47") if(usr.gp>=3500) view(3) << 'ak47_boltpull.wav' usr<<"You buy a ak-47!" usr.clips=0 usr.max=30 usr.gp-=3500 usr.lbullets=30 else usr<<"Your not in the buy zone!"
|
|