team balancing

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
JoeDZ
Private
Posts: 8
Joined: Mon Feb 16, 2004 6:43 pm

team balancing

Post 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 ???
digitac
Sergeant
Posts: 58
Joined: Mon Jul 28, 2003 3:30 pm

Post 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
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

team

Post by tltrude »

I think this is it:

local.player join_team allies
Tom Trude,

Image
JoeDZ
Private
Posts: 8
Joined: Mon Feb 16, 2004 6:43 pm

Post by JoeDZ »

Great !!

Thanks guys !!
Post Reply