09.01.2012, 00:25
I'll give you a little snippet out of my code, so you can get the basic idea. You seem to have a relatively firm grasp on pawno, so it shoudln't be a challenge
pawn Код:
public AutoAssign(playerid)
{
new RedCount, BlueCount;
for(new i=0; i<MAX_PLAYERS; i++)
{
if(EventTeam[i] == EVENT_TEAM_RED)
{
RedCount ++;
}
if(EventTeam[i] == EVENT_TEAM_BLUE)
{
BlueCount ++;
}
}
if(RedCount > BlueCount)
{
return EVENT_TEAM_BLUE;
}
if(BlueCount > RedCount)
{
return EVENT_TEAM_RED;
}
if(BlueCount == RedCount)
{
new decide = random(2);
if(decide == 0)
{
return EVENT_TEAM_RED;
}
if(decide == 1)
{
return EVENT_TEAM_BLUE;
}
}
return 0;
}