Random Teams
#1

Okay, I have it set so players join an event and get placed into a random team and spawn... The random spawn location works perfectly, however the random team selection doesn't... They join random teams but I'm unsure on how I could set it so it spawns them evenly rather than it turning out as 10vs3


pawn Код:
if(ActiveEvent == 2)
    {
        rSpawn++;
        if(rSpawn == MAX_SPAWNS) rSpawn = 0;
        new randomteam = 1+random(2);
        SetPlayerTeam(playerid, randomteam);
        if(randomteam == 1)
        {
            SetPlayerPos(playerid, EventSpawn1[rSpawn][0], EventSpawn1[rSpawn][1], EventSpawn1[rSpawn][2]);
            SetPlayerFacingAngle(playerid, EventSpawn1[rSpawn][3]);
            SetPlayerInterior(playerid,10);
            SetPlayerColor(playerid,RCTeam1);
            SetPlayerVirtualWorld(playerid,1337);
            TeamAmount1++;
        }
        else if(randomteam == 2)
        {
            SetPlayerPos(playerid, EventSpawn2[rSpawn][0], EventSpawn2[rSpawn][1], EventSpawn2[rSpawn][2]);
            SetPlayerFacingAngle(playerid, EventSpawn2[rSpawn][3]);
            SetPlayerInterior(playerid,10);
            SetPlayerColor(playerid,Team2);
            SetPlayerVirtualWorld(playerid,1337);
            TeamAmount2++;
        }
}
Reply


Messages In This Thread
Random Teams - by Slepur - 01.09.2013, 22:36
Re: Random Teams - by Borg - 01.09.2013, 22:48
Re: Random Teams - by Slepur - 01.09.2013, 23:56
Re: Random Teams - by Borg - 02.09.2013, 00:13
Re: Random Teams - by admantis - 02.09.2013, 04:52

Forum Jump:


Users browsing this thread: 2 Guest(s)