ID:150581
 
var/a = input("Select a arena to play in","Arena Selection") in list ("Capture The Flag","Elimination")
switch(a)
if("Capture The Flag")
world << "[src] has joined Capture The Flag."
if("Elimination")
world << "[src] has joined Elimination."
var/t = input("Choose a side.","Your Team?") in list ("Blue","Red")
switch(t)
if("Blue")
icon = 'blue.dmi'
src.loc = locate(/area/login)
if("Red")
icon = 'red.dmi'
src.loc = locate(/area/rlogin)

I am trying to allow a player, once a arena is choosen, to select their color. But since the different arenas are in different spots I need to be able to have switches inside the switches.. This possible?
I get these errors:
paintball.dm:35:error:= :expected "if" or "else"
paintball.dm:36:error:= :expected code block
paintball.dm:36:src.loc:warning: statement has no effect
paintball.dm:36::warning: operation has no effect here

I was also wondering what to use just to make a player join the team with least people? Thanx for any help on either of these.
switch(t)
if("Blue")
icon = 'blue.dmi'
src.loc = locate

I fixed the indentation lol, stupid me.

I was also wondering what to use just to make a player join the team with least people? Thanx for any help on either of these.

Would someone help me with this though?
In response to Oblivian
Oblivian wrote:
switch(t)
if("Blue")
icon = 'blue.dmi'
src.loc = locate

I fixed the indentation lol, stupid me.

I was also wondering what to use just to make a player join the team with least people? Thanx for any help on either of these.

Would someone help me with this though?


Use an if. Like everything else..
if(teamred.players <= teamblue.players)
usr.team = teamread
else
usr.team = teamblue

That won't work, though. Something like that.
In response to Vortezz
Vortezz wrote:
Oblivian wrote:
switch(t)
if("Blue")
icon = 'blue.dmi'
src.loc = locate

I fixed the indentation lol, stupid me.

I was also wondering what to use just to make a player join the team with least people? Thanx for any help on either of these.

Would someone help me with this though?


Use an if. Like everything else..
> if(teamred.players <= teamblue.players)
> usr.team = teamread
> else
> usr.team = teamblue
>

That won't work, though. Something like that.

Ok Thanx :)