This is possible?
#5

Quote:
Originally Posted by timothyinthehouse
Посмотреть сообщение
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)
But there are better sorting methodes than two player loops

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)
Reply


Messages In This Thread
This is possible? - by Baboon - 29.03.2011, 14:03
Re: This is possible? - by Hornet600 - 29.03.2011, 14:06
AW: This is possible? - by Nero_3D - 29.03.2011, 14:21
Re: This is possible? - by Baboon - 01.04.2011, 10:01
AW: Re: This is possible? - by Nero_3D - 01.04.2011, 12:38

Forum Jump:


Users browsing this thread: 2 Guest(s)