15.11.2017, 19:06
Start by debugging your code, check what "array" contains after the first loop, debug the entries that get put into the array in the first loop, do approximately the same for the second loop.
By the way, you're sorting the array by territories won, the second loop will mix up the ids;
After the sorting, the array will look like this;
The second loop loops in order, 0 to MAX_FACTIONS, you're getting the array entry data by order;
Array Entry 1 contains "Ballas" but because you're looping in order, it actually contains "Grove" - this is something you should fix.
By the way, you're sorting the array by territories won, the second loop will mix up the ids;
Код:
Ballas = 0 [1 Win] Grove = 1 [0 Wins] White = 2 [3 Wins]
Код:
White = 2 [3 Wins] Ballas = 0 [1 Win] Grove = 1 [0 Wins]
PHP код:
for(new i = 0; i < MAX_FACTIONS; i++) {
array[i][E_TEAMNAME], array[i][E_TERRITORIESWON]
}

