SA-MP Forums Archive
Auto teams - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Auto teams (/showthread.php?tid=276832)



Auto teams - Woozie® - 15.08.2011

Hi,
Can anyone help me create a code when players connect they auto set to the team with the less players?


Re: Auto teams - [MG]Dimi - 15.08.2011

use random


Re: Auto teams - Woozie® - 15.08.2011

Oh yeah thanks


Re: Auto teams - Woozie® - 15.08.2011

Now i have:
pawn Код:
new Float:Team[][2] =
{
    {1},
    {2}
};

public OnFilterScriptInit()
{
    SetTeamCount( 2 );
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    new rand = random(sizeof(Team));
    SetSpawnInfo(playerid, 0, 277, 2500.0, 1500.0, 10.5, 90.0, 26, 250, 28, 250, 0, 0);
    SpawnPlayer(playerid);
    SetPlayerTeam(playerid, Team[rand][0]);
    return 1;
}
(8 ) : warning 213: tag mismatch
(9 ) : warning 213: tag mismatch
(29 ) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


3 Warnings.


Re: Auto teams - Woozie® - 15.08.2011

nevermind fixed.