ItsMods

Full Version: command for Changing Team?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
I search an command for Changing the team.
How is it?
And:
How can i make a loop?

Sorry for questions like this Undecided
I want to learn GSC, but i didn't found an good tutorial...
(only this: .GSC Modding for Beginners but its to less...)

If you found an god Tutorial about (best in German, but englich is ok too)
please send me an PM, or post it to Thread.

THX
To change team you can use

Code:
player [[level.axis]]();
player [[level.autoassign]]();
player [[level.spectator]]();
player [[level.allies]]();

each one assigns the player to a different team, Allies, Axis, Spectator or Autoassign .. obviously.


A loop can be made in 2 ways

Code:
for( ;; )

or

Code:
while( A VALID ARGUMENT )
the argument could be: while( 1 ); or while( true ); or while( self.name == "gumpu03" ) or whatever(whatever is not an actuall argument lol)
note that with the last one, the loop will only work when you are the player that is using it
And how can i check in which team the player is?
is it like
Code:
if( player [[level.allies]] = 1 )
{
...
}
or is it another way?
if(self.team == "allies")
{}
I saw something about it, helpfull to get clanmate thogheter on server,check "clan name" (botz have 3arc can be helpfull ), or you can assign "vip" tag too but you need players guid and edit gsc to keep it updated. On unranked server is better get some Rcon console, in private match i think will laggy check players all the time better onconnect only but...

Code:
SetClanAsAxis()
{

    for( i = 0; i < level.players.size; i++ )
    {
        player = level.players[i];

        if ( !isDefined( player.pers["team"] ) || player.pers["team"] == "spectator" )
            continue;

        // Check if this player is a clan member
        if ( isDefined( player.pers["clantags"] ) && player.pers["clantags"] != "" )
        {
            newTeam = "axis";
            player setClientDvars( "ui_force_allies", 0,
                                   "ui_force_axis", 1 );
        } else {
            newTeam = "allies";
            player setClientDvars( "ui_force_allies", 1,
                                   "ui_force_axis", 0 );
        }

        if( newTeam == "allies" )
            player [[level.allies]]();
        else if( newTeam == "axis" )
            player [[level.axis]]();


        

    }
    return;
}

this only part of code to give you an idea, need edit Allies too and players check to work, but you can find it on Mods release section, sorry i dont remember wich one was.