28.07.2014, 06:20
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;
}