ID:264944
 
Code:
obj/Ale
icon='Bar.dmi'
icon_state="ale"
verb/Drink()
set src in usr
if(usr.MP<500) usr.MP=usr.MaxMP
usr << "Already at max energy."
else
usr.MP+=35
usr <<"You drink the [src] and gain 35 Energy"
del src


obj/Whisky
icon='Bar.dmi'
icon_state="whisky"
verb/Drink()
set src in usr
if(usr.MP<500) usr.MP=usr.MaxMP
else
usr << "Already at max energy."
usr.MP+=100
usr <<"You drink the [src] and gain 100 MP "
del src






obj/Pie
icon='Bar.dmi'
icon_state="pie"
verb/Eat()
set src in usr
if(usr.HP<500) usr.HP=usr.MaxHP
else
usr << "Already at max health."
usr.HP+=50
usr <<"You eat the [src] and gain 50 Health"
del src




obj/Beer
icon='Bar.dmi'
icon_state="beer"
verb/Drink()
set src in usr
if(usr.MP<500) usr.MP=usr.MaxMP
usr << "Already at max energy."
else
usr.MP+=50
usr <<"You drink the [src] and gain 50 Energy"
del src


Problem description:

Every time I use the else proc,the code gets a bunch of errors.
You only use else after using the if() proc.

Example:

if(src.amazing)
src<<"You are amazing!"
else
src<<"You're not as amazing as that other guy over there"


If you want to use it for that other if proc you have there, just indent them.

obj/Ale
icon='Bar.dmi'
icon_state="ale"
verb/Drink()
set src in usr
if(usr.MP<500) usr.MP=usr.MaxMP
else
usr.MP+=35
In response to Cyberlord84
It compiles now,but every time I use the eat or drink verb it
automatically makes my HP/MP jump to the max amount of mp or hp.

In response to Flare SilverBend
Your code says that user's MP must over <s>9000!</s> 500 to gain less MP, or otherwise the get full MP:
if(usr.MP<500) usr.MP=usr.MaxMP
In response to Martys1103
I got the code fixed.thanks for the help.