Zombie Apocalypse Team Balance
#4

example of it -
pawn Код:
#include <foreach> // this is important ****** to find if u dont have this include

new Iterator:hold<MAX_PLAYERS>;//on top


//now the random tam balancing thing when the map changes
Iter_Clear(hold);
new len = Iter_Count(Player);//return the number of player connected
new var = 0, id;

for(new i = 1; i <= len; i++)
{
    while(var != 1)
             {
              id = Iter_Random(Player);//random id of player
              if(Iter_Contains(hold, id))continue;//means if player is already assgined a team
              var = 1;
             }

Iter_Add(hold, id);

if(i % 2 == 0)SetPlayerTeam(playerid, zombie);//assigning different team to every alternative random playerid
else SetPlayerTeam(playerid, human);
var = 0;
}
Reply


Messages In This Thread
Zombie Apocalypse Team Balance - by flamur2012 - 28.07.2014, 05:27
Re: Zombie Apocalypse Team Balance - by GeekSiMo - 28.07.2014, 05:36
Re: Zombie Apocalypse Team Balance - by flamur2012 - 28.07.2014, 05:48
Re: Zombie Apocalypse Team Balance - by BroZeus - 28.07.2014, 06:20

Forum Jump:


Users browsing this thread: 1 Guest(s)