- Joined
- Nov 21, 2012
- Messages
- 835
Wasted almost half a day and didn't find simple solution.
Map: AoS type, 2 teams TeamA, TeamB, up to 5 players per team (can be 4vs4 or less)
player can be switched to other team - to make teams equal quantity
there are 2 players groups (updated when player left or switched)
there's integer array that represents how many times each players fight on Arena:
udg_ArenaCount[gui playerNumber]
I need a function(s) that allow to:
pick x players from TeamA and add them to player group BattleTeamA (the same with B team)
*and*
those picked players should have lowest values of udg_ArenaCount[playerNumber]
//--------------------------
example: there's 4 players in team A, with following udg_ArenaCount:
udg_ArenaCount[1] = 0
udg_ArenaCount[3] = 2
udg_ArenaCount[4] = 2
udg_ArenaCount[8] = 1
and I need, lets say, 3 players to be picked,
so this should be: player1, player8, and (player3 or player4)
cause player1 has ArenaCount=0 /didnt fight arena yet/
player8 = 1
and one of 2 remaning players: 3 or 4
zibi

Map: AoS type, 2 teams TeamA, TeamB, up to 5 players per team (can be 4vs4 or less)
player can be switched to other team - to make teams equal quantity
there are 2 players groups (updated when player left or switched)
there's integer array that represents how many times each players fight on Arena:
udg_ArenaCount[gui playerNumber]
I need a function(s) that allow to:
pick x players from TeamA and add them to player group BattleTeamA (the same with B team)
*and*
those picked players should have lowest values of udg_ArenaCount[playerNumber]
//--------------------------
example: there's 4 players in team A, with following udg_ArenaCount:
udg_ArenaCount[1] = 0
udg_ArenaCount[3] = 2
udg_ArenaCount[4] = 2
udg_ArenaCount[8] = 1
and I need, lets say, 3 players to be picked,
so this should be: player1, player8, and (player3 or player4)
cause player1 has ArenaCount=0 /didnt fight arena yet/
player8 = 1
and one of 2 remaning players: 3 or 4
zibi