mob/Ore_Buyer/verb/Sell_Ores(/mob/Ore_Buyer in oview(1)) if(ores == 50) credits = round([ores]/[credits])
I don't really know what you're doing, so it would help a lot if you could give a code snippet. Or if you want to just look up "round" when you press "F1" in the Dream Maker.
verb/Sell_ore() set src in oview(1) if(usr.ore<=49) usr<<"You need to mine some ore first!, The smallest amount they will buy is 50" return switch(input("Would you like to sell all your ore?") in list ("Yes","No")) if("Yes") var/X = usr.ore / 50 var/Y = X * 50 usr.credit = X + usr.credit usr.ore -= Y if("No") return
see, user can have more then 50 ore so if he has 75 ore he would get 1.5 credits i dont want it to cash the other 25 in??? is that possible??
verb/Sell_ore() set src in oview(1) if(usr.ore<=49) usr<<"You need to mine some ore first!, The smallest amount they will buy is 50" return switch(input("Would you like to sell all your ore?") in list ("Yes","No")) if("Yes") var/X = usr.ore / 50 var/Y = X * 50 usr.credit = round(X + usr.credit) // I think that'll work... usr.ore -= Y if("No") return
verb Sell_ore() set src in oview(1) if(usr.ore<=49) usr<<"You need to mine some ore first!, The smallest amount they will buy is 50" return switch(input("Would you like to sell 50 ore for 1 credit??") in list ("Yes","No")) if("Yes") ++usr.credit// adds one credit to the user usr.ore=max(0,usr.ore-50) // subtracts 50 ore from the user
I don't really know what you're doing, so it would help a lot if you could give a code snippet. Or if you want to just look up "round" when you press "F1" in the Dream Maker.