Page 1 of 1

team balancing

Posted: Thu Feb 19, 2004 1:02 pm
by JoeDZ
sigh,,,

I did several searches and looked through about 24 pages of results and still couldn't come across a solution, so here goes :))

I'm playing around with an auto-team balance script in my map, I have it to the point where it actually determines how many players it needs to move and randomly selects them, but I can't seem to assign them to the other team.

The actual command to assign them is what I am looking for...

I've been trying

$player[local.index].dmteam = axis

$player[local.index].dmteam = allies

based on which direction the balance is needed, but can't get it to work. Anyone know what the actual syntax is to assign a player to a specific team ???

Posted: Thu Feb 19, 2004 7:52 pm
by digitac
maybee you can try this

For counting players on each teams

Code: Select all

for ( local.n = 1 ; local.n <= $player.size ; local.n ++ )
{
   if ( $player[local.n].dmteam == "axis" )
   {
     local.onaxis++
   }
   if ( $player[local.n].dmteam == "allies" )
   {
     local.onallies++
    }
}
Here we gonna make the players swap teams

Code: Select all

for ( local.n = 1 ; local.n <= $player.size ; local.n ++ )
{
   if ( $player[local.n].dmteam == "axis" )
     $player[local.n].stufftext ("join_team allies")
   if ( $player[local.n].dmteam == "allies")
     $player[local.n].stufftext ("join_team axis")
}


or something like that

u can experiment with it

team

Posted: Thu Feb 19, 2004 11:25 pm
by tltrude
I think this is it:

local.player join_team allies

Posted: Fri Feb 20, 2004 11:35 am
by JoeDZ
Great !!

Thanks guys !!