mob
Login()
switch(input ("Do you want to load a character?","Charmed") in list ("New Character","Load Character"))
if("New Character")
usr << "Creating a new character!"
usr.name = input("What is your name?","Charmed",null) as text
usr.team = input("What is your alignment?","Charmed") in list ("Evil", "Good")
if("Evil")
usr.class = input("What is your race?","Charmed") in list ("Dark Witch","Darklighter")
usr.loc = locate(1,1,1)
else
usr.class = input("What is your race?","Charmed") in list ("Good Warlock", "Good Demon")
usr.loc = locate(1,1,1)
if("Load Character")
usr << "Sorry, loading is coming soon! Logging you out now!"
del src
Problem description: When I compile it says I have no errors but when i play and pick good, it comes up with the choice's for evil (Dark Witch and Darklighter). What have I done wrong?
-mixed usr and src usage.
-usr abuse.
In short, you need to use 'src' there only.
Also, what is causing the problem your experiencing is:
That checks if a hardcoded TRUE value (any non-empty text string is a true value, of course) is true, and if so executes the code indented under it. So it always executes that code.
You are trying to use switch() syntax with no switch(). If already you'd add a switch(team) before that line, but you really just need to check the 'team' var once with an if().