Quote:
Originally Posted by Backstabnoob
Code:
new Players[32], iNum, Kills[sizeof(Players)], Best[2], i
get_players(Players, iNum, "e", "TERRORIST")
for(i = 0; i < iNum; i++)
Kills[Players[i]] = get_user_frags(Players[i])
SortIntegers(Kills, sizeof(Players), Sort_Descending)
Best[0] = Kills[0]
get_players(Players, iNum, "e", "CT")
for(i = 0; i < iNum; i++)
Kills[Players[i]] = get_user_frags(Players[i])
SortIntegers(Kills, sizeof(Players), Sort_Descending)
Best[1] = Kills[0]
// best T player: Best[0], best CT player: Best[1]
I guess it can be done without two loops, but I can't think of any other way
|
That may give fall results. If one person is 10 and 0, and the other is 10 and 40, the 10 and 40 person may be earlier in the array.
Best thing to do with your method is to get the players, run a SortCustom1D on it, and then check the players frags AND deaths to the other. Then return the correct amount for it to sort for you.
__________________