I am matching players by their score and want to shuffle teams based on their score (to make teams even).
I don't know if this works yet, but I hope it does
I have some doubts, because I'm not sure if players can swap team to Spectators - Can they? They certainly cannot swap to a team that is already full?
Is there a "best practice" for swapping teams or players?
PHP Code:
// Change Survivors team to Spectators (TEMPORARILY)
for (i = 0; i < GetArraySize(SurvivorArray); i++)
ChangeClientTeam(GetArrayCell(SurvivorArray, i), TEAM_SPECTATORS);
// Change Infected team to Survivors
for (i = 0; i < GetArraySize(InfectedArray); i++)
ChangeClientTeam(GetArrayCell(InfectedArray, i), TEAM_SURVIVORS);
// Change Spectators (TEMPORARILY) team to Infected
for (i = 0; i < GetArraySize(SurvivorArray); i++)
ChangeClientTeam(GetArrayCell(SurvivorArray, i), TEAM_INFECTED);
__________________