29.03.2011, 14:03
Код:
for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { for(new a = 0; a < MAX_PLAYERS; a != i; a++) { if(IsPlayerConnecteD(a)) { } } } {
for(new i = 0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { for(new a = 0; a < MAX_PLAYERS; a != i; a++) { if(IsPlayerConnecteD(a)) { } } } {
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?
|
(a < MAX_PLAYERS) && (a != i)
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)