if(usr.key = "CBM1","WizDragon","WxCherryxBombxW","Sariat","NightMare619", "The choosen one alena","Spudgun")
This is my code for my login. This is so only these people log in, but i get one error saying if: extra args. How would i get rid of this error?
ID:178654
Apr 20 2002, 7:07 am
|
|
Tazor07 wrote:
if(usr.key = "CBM1","WizDragon","WxCherryxBombxW","Sariat","NightMare619", "The choosen one alena","Spudgun") You've actually got two problems. Darkness explained one of them. Another problem is that you're using = instead of ==. Even though == won't work for you here and would be entirely nonsensical, == is the comparison operator and = is for assignment or for named arguments. The reason the error message reads as it does is because it thinks you're calling a proc named if like this: if_proc("CBM1","WizDragon","WxCherryxBombxW","Sariat","NightMare619","The choosen one alena","Spudgun") I wrote that as if_proc() instead of if() to show you how the DM compiler is seeing it. It's seeing usr.key="CBM1" as a single argument, where usr.key would be the name of that argument, just like if you'd called a proc like this: myproc(a=2,b=4) Anyway, Darkness's answer will get you back on track, but basically I wanted to show you why you got the error message you did. Hopefully that will make it a little clearer in case you ever run into a similar situation. Lummox JR |
In response to Lummox JR
|
|
I see a == problem.
if(usr.key == "Blah") --SSJ4_Gohan_Majin |
Thats because an if() doesn't do that many args, you need to use a list like this..
var/list/admins = list("me","you")
if(usr.key in admins)