ID:142335
 
Code:
mob
Login()
switch(input("What team would you like to join?(Requires GM approval)", text) in list ("blue","red")
if("blue")
for(var/mob/M in world)
if(M.GM == 1)
switch(M,input("[src] wants to join blue team. agree?", text) in list ("yes","no"))
if("yes")
src.team = "blue"
src.overlays += 'blueover.dmi'
else
src<<"[M] declined! try joining the other team!"
if("red")
for(var/mob/M in world)
if(M.GM == 1)
switch(M,input("[src] wants to join red team. agree?", text) in list ("yes","no"))
if("yes")
src.team = "red"
src.overlays += 'redover.dmi'
else
src<<"[M] declined! try joining the other team!"


Problem description:
COMPILATION ERROR! it says that the if("blue") has a missing comma or right parent :/ it doesnt

In a situation like this, it is common for the compiler to report the error on the line below where the error has occurred.
Paren, not parent. As in, parenthesis.
Often, Dream Maker reports errors for the line directly after the line where the error is (since it reads the code in advance, and if the mistake is on the last character, it ends up like that). Your switch() line is missing a comma or right "paren", namely the latter. You need to have a double right "paren" after the "list", one to close the list() and one to close the switch().

Note that you're doing unneeded things here. Change the if("blue") to an 'else' instead, or better yet, use a simple if()-else statement rather than a switch().

EDIT: To predict your next post: You are going to suffer from the black screen syndrome because your Login() isn't locating the player. Calling ..() is recommended, even if you're also locating him yourself.
Also, like I stated in a different post, repeating code is badly designed. You can set a variable and have the block of code under the if()s only once.
In response to Kaioken
EDIT: To predict your next post: You are going to suffer from the black screen syndrome because your Login() isn't locating the player. Calling ..() is recommended, even if you're also locating him yourself.


wrong :P im making two different spawn points for the teams. the missing paren is fixed, but... now came error "extra args"

now thats annoying
In response to Gogeta126
Gogeta126 wrote:
wrong :P im making two different spawn points for the teams.

It could be that I'm wrong, but again, I don't see you placing the player mob anywhere in your code here. And other Login() overrides (you shouldn't even have multiple in 1 project if you do) aren't going to run because you haven't called the parent (..()).

the missing paren is fixed, but... now came error "extra args"

Yes, I see the cause. This line (which you already know but failed to tell us):
switch(M,input("[src] wants to join blue team. agree?", text) in list ("yes","no"))


now thats annoying

It's not that I'm really mad at you, but you posting about every error is the thing which is annoying. =P Try to solve your problems yourself. If we solve everything for you, you're not going to get better. These 2 errors you've encountered are very simple errors even [post-DM-Guide] newbies should be able to fix easily.

Hints: Use the DM Reference (F1 in DM). A lot. Read your code even if you think you know exactly what it does because you wrote it; obviously you have a mistake. Read the above line a few times as well as the relevant DM Reference entries (the one for switch(), perhaps input()), and the error, until you get it. The errors in fact are not cryptic or hard to understand, but you need to make an effort to do it. I take it you know what args (short for 'arguments') are? If not, they are also covered in the DM Reference, like most things.
In response to Kaioken
WOOT there i go. My eyes just really hurt maybe thats why i didnt get it propely in the first place. But i've done this before and i know... ive put M, in the wrong place >.>

thanks for waking me up a bit.