01.04.2011, 12:38
Quote:
okay, because I want to use variables in it for my scoreboard in the end of the session, like who has the most kills etc. But is there a way to ingnore if a and i are the same?
|
pawn Код:
(a < MAX_PLAYERS) && (a != i)
That would be Insertionsort, just ****** Sorting algorithm for more advanced once
Some advanced sorthing algorithm like quicksort can be found in this forum
pawn Код:
new
i,
j,
id,
value,
id[sizeof Kills] = {0, 1, 2, ...};
for( ; i != sizeof Kills; ++i) {
value = Kills[i];
for(j = i; (j != 0) && (Kills[id[j - 1]] < value); --j) {
id[j] = id[j - 1]
}
id[j] = i;
}
//id[0] is the id with the most kills (Kills[id[0]] would be the kills)