Sorting Top killers
#2

PHP код:
new arrPlayers[MAX_PLAYERS],
    
cnt,
    
j,
    
k,
    
bool:startAgain=false,
    
s[300];
foreach(new 
i:Player){
    if(
Player[i][pGroup] == gattacker || Player[i][pGroup] == gattacked)arrPlayers[cnt++]=i;
}
for(new 
icnti++){
    
j=arrPlayers[i];
    
k=arrPlayers[i+1];
    if(
Player[j][Kills] > Player[k][Kills])arrPlayers[i+1]=j,arrPlayers[i]=k,startAgain=true;
    if(
i==cnt-&& startAgain)i=0,startAgain=false;
}
for(new 
icnti++){
    
j=arrPlayers[i];
    
format(ssizeof(s), "%s\n%d\t%s\t%d"sPlayer[j][pID], Player[j][Name], Player[j][Kills]); 

Reply


Messages In This Thread
Sorting Top killers - by TwentyFour - 19.10.2018, 18:47
Re: Sorting Top killers - by g1venchy - 19.10.2018, 20:01
Re: Sorting Top killers - by g1venchy - 19.10.2018, 22:54
Re: Sorting Top killers - by agit - 20.10.2018, 05:26
Re: Sorting Top killers - by TwentyFour - 22.10.2018, 07:09

Forum Jump:


Users browsing this thread: 2 Guest(s)