ID:1684178
 
(See the best response by GhostAnime.)
Code:
mob
proc
new_char()
src.choose_name()
src.loggedIn=1
// below is demo stuff
switch(input("Please select your gender") in list ("Male","Female"))
if("Male")
switch(input("Please select a race") in list ("Human","Drugan","Birdon","Moanky"))
if("Human")
switch(input("Please select skin a tone") in list ("White","Tan","Black"))
if("White")
//Generate player and place them in the world.
//Add hair later.
select_class
switch(input("Great now that we know what you look like, please select a class. You can't change this later so choose wisely.") in list ("Mage","Rogue","Soldier","Warrior"))
if("Mage")
switch(input("You can't change this later. Are you sure you want the Mage?") in list ("Yes","No"))
if("No")
return select_class


Problem description:
So what i am trying to do is make it so when a player selects their class they get a warning, "You can't change this later. Are you sure about this?" and then they can say yes or no. When they say no i want them to return to te class
Best response
First off, why do you have class options under the gender options? Unless you plan to make some classes gender specific, this would cause you to copy/paste and must be edited in two places to fix a specific issue if one arrises.

A more sufficient way is to separate it:
src.gender = lowertext(input("Please select your gender") in list ("Male","Female"))  //  Yes, there is a gender variable defined in BYOND. So if you use \his[src] or \her[src], it would use the correct his/her depending on the gender

var/Classes = list ("Human" = list("White","Tan","Black"),"Drugan","Birdon","Moanky") + \
(src.gender == "male")?"Wizard":"Witch" // X?Y:Z is a compact if() saying if(X){return Y}else{return Z}.

src.class = null

while(!src.class)
src.class = input("What class do you want to be in?", "Class") in Classes

if(istype(Classes[src.class], /list)) // If a list is found as a value of the entry, it is assumed it is a skin choice
src.skin = input("What skin tone do you want have", "Skin Tone") in Classes[src.class]

if("No" == alert("Are you sure you want to be a [src.gender] [src.skin] [src.classes]?", "Confirmation", "No", "Yes")
src.class = null
// Since class is now null, the while() will repeat back from the top.

src << "Welcome to THE VOID!"
src.z = 0