ID:264939
 
Code:
    check_wealth()
if (usr.wealth -= 0)
usr << "You have no Gold!. Get out there and do something!"
else
usr << "You have [usr.wealth] Gold!"


Problem description:
Ok, I'm trying to get the my check wealth verb to tell the player to go do something if they have no gold, and so I thought about using an If, Else system to do so, but the compiler gives me a missing expression error. What should I change to make it work right?

-= basically means x = x - y.

The correct operators would be <= (less than or equal to.)

If your proc is simply checking to see if they have any gold at all and not a specific amount, just do...

check_wealth()
if(wealth)
src << "You have [wealth] gold."
return 1
In response to LordAndrew
Thank you very very much! :)
Just thought I'd add for any future reference that while <= is good in most situations, you may find an odd occasion where you need to just use < and that's fine by itself.

In this case <= is correct.