ID:178798
Apr 3 2002, 4:04 pm
|
|
Yes I was wondering If someone could tell me how to stop negative numbers in money and other vars? ANyone who can help plz be my guess
|
In response to Kappa the Imp
|
|
ok i am not sure heres an ex of my code
turf Class_3_Station icon = 'Turfs.dmi' icon_state = "spacestation" density = 1 Click() var/i = input("Would you like to Buy or Sell any goods here?","Omega Station") in list ("Buy Dilithium 24creds 1unit","Buy Tools 5creds 1unit","Sell Dilithium 12creds 1unit","Buy Fuel 5creds 5units","Nevermind") // ask the player what the variable 'r' is (ask what race they want to be) switch(i) if("Buy Dilithium 12creds 1unit") // the program already knows what it's comparing (r). this was established with the line 'switch(r)'. now the program is checking to see what 'r' equals. just use if("example") to do so, because we've already checked to see what we're looking at usr.wealth-=24 usr.dilithium+=1 if("Buy Tools 6creds 1unit") // the program already knows what it's comparing (r). this was established with the line 'switch(r)'. now the program is checking to see what 'r' equals. just use if("example") to do so, because we've already checked to see what we're looking at usr.wealth-=6 usr.Tools+=1 if("Sell Dilithium 12creds 1unit") usr.wealth+=6 usr.dilithium-=1 if("Buy Fuel 5creds 5units") usr.wealth-=6 usr.fuel+=5 if("Nevermind") |
Is that what your looking for?
-Kappa the Imp