Here is the code.
---------------------------------
mob
Master_Trainer
icon = 'man.dmi'
icon_state = ""
density = 1
verb
Train()
if(usr.maxpowerlevel <= 999999)
if(usr.zenni <= 99999)
alert("I will only train those with PL's of over 1000000 and my price is 100000 zenni")
var/plquest = 1
if(usr.maxpowerlevel <= 999999)
if(usr.zenni <= 99999)
if(plquest == 1)
alert("Come Back when you are strong enough and have 100000 zennni")
if(usr.maxpowerlevel >= 1000000)
if(usr.zenni <= 99999)
alert("You seem strong enough but you have not got enough zenni yet")
if(usr.maxpowerlevel <= 999999)
if(usr.zenni >= 100000)
alert(" You seem to have enough zenni but you must also have a PL of more than 1000000 to take my training")
if(usr.maxpowerlevel >= 1000000)
if(usr.zenni >= 100000)
alert("You have meet the requirements for my training")
switch(input("Do you wish to take my training?","Master Training",text) in list("Yes","No"))
if("yes")
flick("sparfury",usr)
usr.maxpowerlevel = (usr.maxpowerlevel * 3)
var/trainingtaken = 1
if(trainingtaken == 1)
alert("You have already taken my training. Go Away!")
Any Ideas?
Oh and one thing I know some of the indentation is wrong here but that is just becase of when I cut and pasted it.
Thanks in advance.
ID:261802
Jul 19 2003, 2:52 pm
|
|
Any Ideas? Well i dont know whats not working so...no Oh and one thing I know some of the indentation is wrong here but that is just becase of when I cut and pasted it. Do you know about [dm][/dm] tags? ( Dont use [ or ] use < > ) |
In response to Wanabe
|
|
Quest.dm:12:if :warning: if statement has no effect
Quest.dm:16:if :warning: if statement has no effect Quest.dm:17:if :warning: if statement has no effect Quest.dm:20:if :warning: if statement has no effect Quest.dm:23:if :warning: if statement has no effect Quest.dm:26:if :warning: if statement has no effect Quest.dm:15:plquest :warning: variable defined but not used Quest.dm:33:trainingtaken :warning: variable defined but not used Those are the error messages I get when I try to compile. hope that helps. :) |
In response to Vegeto_ssj100
|
|
These errors appear because you have stuff like this
if(src.zenni<=99999999) if(src.somthingelse) it should be somthing like: if(src.zenni<=999999999 && src.somthingelse) or if(src.zenni<=9999999) if(src.somthingelse) |
Your indentation on pretty much all of your If statements are completely wrong.
Train() if(usr.maxpowerlevel <= 999999) if(usr.zenni <= 99999) alert("I will only train those with PL's of over 1000000 and my price is 100000 zenni") That says if(usr.maxpowerlevel <= 999999)- do nothing (This can create an error because an if statement usually needs something behind it, where yours is just followed by another control statement. if(usr.maxpowerlevel <= 999999) if(usr.zenni <= 99999) if(plquest == 1) alert("Come Back when you are strong enough and have 100000 zennni") On this (I'm not sure) You want it to make sure their powerlevel, quest, and zennie are all applicable, like stated before you should use if(usr.maxpowerlevel >= 1000000&& usr.zennie >= 100000&& plquest == 1) then do other stuff Sorry the 9999 annoy me :P. Anyhow check your indentation, alot of errors amazingly come from things you overlook. Hope I help James |
In response to SSJ2GohanDBGT
|
|
Thanks that fixed most of the problems but now when I try to compile it gives me these errors.
---------------------- Quest.dm:27:error:list:undefined proc Quest.dm:28:error::invalid expression Quest.dm:18:plquest :warning: variable defined but not used ---------------------- Here is the code now. mob Master_Trainer icon = 'man.dmi' icon_state = "" density = 1 verb Train() set src in oview(1) set category = "Communcation" if(trainingtaken == 1) alert("You have already taken my training. Go Away!") if(usr.maxpowerlevel <= 999999 && usr.zenni <= 99999) alert("I will only train those with PL's of over 1000000 and my price is 100000 zenni") var/plquest = 1 if(usr.maxpowerlevel <= 999999 && usr.zenni <= 99999 && plquest == 1) alert("Come Back when you are strong enough and have 100000 zennni") if(usr.maxpowerlevel >= 1000000 && usr.zenni <= 99999) alert("You seem strong enough but you have not got enough zenni yet") if(usr.maxpowerlevel <= 999999 && usr.zenni >= 100000) alert(" You seem to have enough zenni but you must also have a PL of more than 1000000 to take my training") if(usr.maxpowerlevel >= 1000000 && usr.zenni >= 100000) alert("You have meet the requirements for my training") input("Do you wish to take my training?","Master Training",text) in list("Yes","No") if("yes") flick("sparfury",usr) usr.maxpowerlevel = (usr.maxpowerlevel * 3) usr.zenni -= 100000 var/trainingtaken = 1 |
In response to Vegeto_ssj100
|
|
Someone please help!!!
|
In response to Vegeto_ssj100
|
|
put the line with the yes/no question in a switch() statement. and delete the line that says var/plquest = 1
you never use that variable again in your code, so it is useless... did you mean to change the variable of the player, you might try usr.plquest = 1... only if that is a true variable... otherwise delete it. |
In response to Ter13
|
|
Ter13 wrote:
you might try usr.plquest = 1... only if that is a true variable... How do I make sure it is a true variable? |
.::DBHavenMaster::.