What is wrong with this code? It compiled properly but, when it is in runtime, it states:
runtime error: wrong type of value for list
proc name: Beta verb (/mob/verb/Beta_verb)
source file: Chat.dm,408
usr: Main OPDrafonis (/mob)
src: Main OPDrafonis (/mob)
call stack:
Main OPDrafonis (/mob): Beta verb()
mob/verb/Beta_verb()
if(usr.ckey == "Goku_dragon_fist" || "mazarot")
usr.verbs += /mob/GM_verbs
usr.verbs += /mob/admin_GM_verbs
usr.Goku()
else
usr << "You aren't one of the premium beta testers! Or your key is Drafonis."
mob/proc/Goku()
if(usr.ckey == "Goku_dragon_fist")
usr.verbs += /mob/master_GM_verbs
usr << "You are Goku_dragon_fist!"
else
usr << "You are not of the Goku_dragon_fist!"
I included the proc because it might have something to do with this.
ID:149152
Jun 26 2002, 9:08 am
|
|
In response to Lummox JR
|
|
Well, now it won't run the else in the verb.
|
In response to Drafonis
|
|
Drafonis wrote:
Well, now it won't run the else in the verb. If you made the correct changes, it should have. Show me your updated code. Lummox JR |
In response to Lummox JR
|
|
Lummox JR wrote:
Drafonis wrote: mob/verb/Beta_verb() if(usr.ckey == "gokudragonfist" || "mazarot") usr.verbs += typesof(/mob/GM_verbs/verb) usr.verbs += typesof(/mob/admin_GM_verbs/verb) usr.Goku() else usr << "You aren't one of the premium beta testers! Or your key is Drafonis." mob/proc/Goku() if(usr.ckey == "gokudragonfist") usr.verbs += typesof(/mob/master_GM_verbs/verb) usr << "You are Goku_dragon_fist!" else usr << "You are not of the Goku_dragon_fist!" |
In response to Drafonis
|
|
Drafonis wrote:
mob/verb/Beta_verb() DUH! You didn't read the other thread I pointed you to. The way you're using || is wrong. This was the very first thing I mentioned in my reply. Lummox JR |
In response to Lummox JR
|
|
Lummox JR wrote:
Drafonis wrote: Um, what is the one? |
In response to Drafonis
|
|
Should be,
if(src.key == "blah"||src.key=="boo")//just an example But there are easiers ways like, Adding to list var/list/beta = newlist("blah","boo") if(beta.Find(src.key)) blah blayh |
The other problem, whhich is causing the error, is that /mob/admin_GM_verbs is not a list of verbs; it's probably only a special type of mob that holds those verbs. This being the case, what you probably want is this:
usr.verbs += typesof(/mob/admin_GM_verbs/verb)
Lummox JR