ID:149718
 
i have tried so much different stuff, usr, src, different way at approaching it like making it add the verb, and all of it comes out fine no errors or anything but when i tell it to do it in the game it asks if i want to but then doesnt do it. Even if i select no it doesn't say anything. I have it set as a mob if i try to make it an obj rcet's movement code doesn't work.


heal
mouse_over_pointer = MOUSE_ACTIVE_POINTER
icon = 'heal.dmi'
density = 1
layer = 10
Click()
var/A = input("Hey [usr.name] it will cost $300, would you like to be healed?","Heal") in list("Yes","No")
if(A == "yes")
if(usr.money >= 300)
Lock(usr)
usr.loc = locate(4,11,1)
usr.money -= 300
while(usr.pl / usr.maxpl < 1)
usr.pl += (usr.maxpl * (1 / 2))
sleep(10)
usr << "You are healed!"
Unlock(usr)
usr.pl = usr.maxpl
else
usr << "You don't have enough money!"
if(A == "no")
usr << "Bye then."
I think i found the problem do yu have it like this
mob
heal
or just plain
heal
with no mob before it
that will most likely be the problem
In response to Richter
main.dm:737:error:mouse_over_pointer:undefined var
main.dm:738:error:icon:undefined var
main.dm:739:error:density:undefined var
main.dm:740:error:layer:undefined var
main.dm:746:error:Lock:undefined proc
main.dm:752:error:Unlock:undefined proc
main.dm:741:error:Click :undefined proc

redo.dmb - 7 errors, 0 warnings (double-click on an error to jump to it)

nope just causes problems

var/A = input("Hey [usr.name] it will cost $300, would you like to be healed?","Heal") in list("Yes","No")
if(A == "yes")
if(usr.money >= 300)
Lock(usr)
usr.loc = locate(4,11,1)
usr.money -= 300
while(usr.pl / usr.maxpl < 1)
usr.pl += (usr.maxpl * (1 / 2))
sleep(10)
usr << "You are healed!"
Unlock(usr)
usr.pl = usr.maxpl
else
usr << "You don't have enough money!"
if(A == "no")
usr << "Bye then."

The problem is that the text strings are case sensitive...

Meaning that in the line "var/A = input("Hey [usr.name] it will cost $300, would you like to be healed?","Heal") in list("Yes","No")"

The "Yes" and "No" are capitalized... But in your if() checks...you ask to check if A = "yes" or "no"... Not capitalized... Therefore...A will never be either of those two choices...so the proc does nothing..."even if you click 'no'"...

So change them to if(A == "Yes") and if(A == "No") and it should work fine...
man you don't have to hate to ask for help, just ask... I have been working on these games for a while now and I still get stuck on stupid stuff sometimes and look gladly to the forums.
In response to SuperSaiyanGokuX
**Smashes head against his keyboard**

STUPID STUPID STUPID,

thats what i hate about programming you can be stuck on something for hours and it has the simiplest answers. Thanx a lot
In response to Netshark010101
No problem...

And don't worry...we've all had that happen to us at one time or another...
In response to SuperSaiyanGokuX
In MVC I've sat for hours looking for the cause of several hundred errors, turning out I forgot to remove a simple '}' from a statement (there was a lot of code to look through ^_^).