ID:149453
 
My proc is like this:

BetaCheck()
if(src.key == "Drafonis","Abam55","G2boi","Koruku")
src << "You're in"
else
src << "INTRUDER! OFF TO THE BRIG!"
del(src)
here try this

proc/BetaCheck()
if(usr.key == "Drafonis")
usr << "You're in"
else
usr << "INTRUDER! OFF TO THE BRIG!"
del(usr)
if(usr.key == "Abam55")
usr << "You're in"
else
usr << "INTRUDER! OFF TO THE BRIG!"
del(usr)
if(usr.key == "G2boi")
usr << "You're in"
else
usr << "INTRUDER! OFF TO THE BRIG!"
del(usr)
if(usr.key == "Koruku")
usr << "You're in"
else
usr << "INTRUDER! OFF TO THE BRIG!"
del(usr)
Drafonis wrote:
My proc is like this:

BetaCheck()
if(src.key == "Drafonis","Abam55","G2boi","Koruku")
src << "You're in"
else
src << "INTRUDER! OFF TO THE BRIG!"
del(src)


You can't check multiple keys using the , operator, instead use the || operator.

example:

switch(src.key)
if("Key1" || "Key2" || "Key3")
//do stuff
In response to Nadrew
Actually, in switch you can just do:
if("blah","yadda","bleh")
In response to tenkuu
tenkuu wrote:
Actually, in switch you can just do:
if("blah","yadda","bleh")


I learn new things about switch() alot (well not new things I knew it did that, but when you don't use things alot they kinda slip your mind =P)

Ps,
You need to close your <DM> tags.

The easiest solution is just to keep a BetaList and search that.

<code>var/list/BetaList = list("Drafonis","Monkey","Etc...")</code>

Then check it:

<code>mob/Login() if(BetaList.Find(usr.key)) //okay...</code>