ID:2162675
 
(See the best response by Lummox JR.)
Code:
Rank_Up()
switch(input(usr,"What would you like to rank their rank to?") in list("Jounin","Chuunin","Genin","Cancel")
if("Jounin")
usr<<"[M] is now a Jounin."
for(var/mob/X in world)
if(X.Village==M.Village)
X<<"<font color = #BB0EDA>Village Information:</font> [M] has been promoted to Jounin!"
M.rank = "Jounin"
M.ElementalPoints+=13
M.StartingPoints+=3
if(M.Village=="Leaf")
var/obj/Clothes/LJouninsuit/B=new()
B.loc=M
if(M.Village=="Rock")
var/obj/Clothes/RJouninsuit/B=new()
B.loc=M
if(M.Village=="Sound")
var/obj/Clothes/SJouninsuit/B=new()
B.loc=M
if(M.Village=="Rain")
var/obj/Clothes/RaJouninsuit/B=new()
B.loc=M
if("Chuunin")
usr<<"[M] is now a Chuunin."
for(var/mob/X in world)
if(X.Village==M.Village)
X<<"<font color = #BB0EDA>Village Information:</font> [M] has been promoted to Chuunin!"
M.rank = "Chuunin"
if(!M.GottenChuunin)
M.GottenChuunin=1
M.ElementalPoints+=10
var/obj/Clothes/Chuunin_Vest/A = new
A.loc = M
if(M.Village=="Sound")
var/X=rand(1,3)
if(X==1)
var/obj/Clothes/SoundBeltPurple/C=new()
C.loc=M
if(X==2)
var/obj/Clothes/SoundBeltBlack/C=new()
C.loc=M
if(X==3)
var/obj/Clothes/SoundBeltWhite/C=new()
C.loc=M
if("Genin")
usr<<"[M] is now a Genin."
for(var/mob/X in world)
if(X.Village==M.Village)
X<<"<font color = #BB0EDA>Village Information:</font> [M] has been promoted to Genin!"
M.rank = "Genin"
var/obj/Clothes/Headband/B = new/obj/Clothes/Headband
B.loc = M
if("Cancel")
return


Problem description:
Basically I'm trying to make a single verb that has the different ranking in it. I hate the whole "Make Jounin", "Make Chuunin", "Make Genin" thing since it clutters my coding and takes up space in my in-game tabs. Is there anyway to fix this?

This is the error I get -
code\Admin.dm:1118:error: if: missing comma ',' or right-paren ')'

It's also highlighting the if("Jounin") part of the coding. I tried taking that bit out all together to see if it'll happen to the if("Chuunin") and if("Genin") and of course it did.
At the end of the switch, you need another )
Best response
I would also highly recommend you not add "Cancel" as a choice, but instead use "as null|anything in list" after your input(). The null option means that the user will have a cancel button on the input box, which is nicer, and you just have to handle null instead of "Cancel" as a choice in your switch.