ID:178635
 
how do i make it so an inn guy will give u the option of staying the night or not? like after he asks the question then the option bar will appear.........
(do i need to have have GP? and HP? first?)
You mean in a list like in most games? Try the input proc. You could use the alert proc for that too, try looking that up.
Ok first off try not to tell us what you want the player to do. Tell us what you want the code to do. But to do that do something like this
mob/inkeeper
verb/talk()
input("Would you like to spend the night") in list ("Yes","No")
if("Yes")
usr << "That will be 100 Gold"
if(usr.gold>=100)
usr << "Enjoy your stay"
usr.gold-=100
usr.HP=usr.Max_HP
else
usr << "You don't have enough gold"
else
usr << "Ok don't spend the night

Look guys I did something right. I feel so proud of myself.
In response to BurningIce
BurningIce wrote:
Look guys I did something right. I feel so proud of myself.

Nope you messed it up. You totally left out the switch() proc that you needed to use.
In response to Nadrew
I thought you only need it if there are multiple if statememnts.
In response to BurningIce
I also see i forgot to put set src in view()
In response to BurningIce
mob/inkeeper
verb/talk()
set src in view(1)
choice=input("Would you like to spend the night") in list ("Yes","No")
switch(choice)
if("Yes")
usr << "That will be 100 Gold"
if(usr.gold>=100)
usr << "Enjoy your stay"
usr.gold-=100
usr.hp=usr.max_hp
else
usr << "You don't have enough gold"
else
usr << "Ok don't spend the night"

There this works I tested it. That was a stupid midtake on my part but at least you learn from your mistakes :P
In response to BurningIce
i need to add gp and hp will u help me with that? because im getting 6 errors of undefined procs (all the new stuff lol)
ok thanx