01.09.2013, 22:36
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++;
}
}