ID:270805
 
Well, i was thinking about how i'd make different icon_states depending on the variable for quantity of the currency for the player.So, i tried it out, it seems to work fine, except, i wasnt sure how to check if it was a [certain number] through a [certain number].I thought that
if(src.amount=1,15)
or something similiar would work, but it didnt.How would i check for numbers inbetween two numbers?I thought this might work since it does in rand() but it doesnt, the errors it received are on the if statements.It says, extra args, which i am sure has to do with the "," character.
if(amount>=lowerbound&&amount<=upperbound)


Or, if you want to show off your m4d 1337 sk|llz:

 #define BETWEEN(a,l,u) (((a)>=(l))&&((a)<=(u)))


And then you can just go

if(BETWEEN(amount, lowerbound, upperbound))
//stuff
In response to Jp (#1)
#define BETWEEN(a,l,u) (((a)>=(l))&&((a)<=(u)))

obj/Gold
icon='Objects.dmi'
New()
if(BETWEEN(amount, 1, 15))
icon_state="Gold1"
if(BETWEEN(amount, 16, 20))
icon_state="gold2"
icon_state="Gold"
var/amount
verb/Get()
set src in oview(1)
usr<<"You have obtained [amount] quantity of gold."
usr.Currency+=amount
del(src)

So, this would work?