help with md-sort.inc
#1

PHP код:
    const max_sort 3;
    new 
toSort[MAX_PLAYERS][2],  bool:foundtmpstring[2048];
    for(new 
i=GetPlayerPoolSize(),idx!= -1i--)
    {
        if(!
IsPlayerConnected(i) || IsPlayerNPC(i) || PlayerDamage[i] <= 0) continue;
        
toSort[idx][0] = PlayerDamage[i];
        
toSort[idx++][1] = i;
    }
    
SortDeepArray(toSort0, .order SORT_DESC);
    
SendClientMessageToAll(-1"{ffdd99}*** Top players by damage");
    for(new 
ii<max_sorti++)
    {
        if(
toSort[i][0] == 0) break;
        
found=true;
        
format(tmpstringsizeof(tmpstring), "{ffdd99}*** %i) %s with %d damage"1PlayerName[i], PlayerDamage[i]);
        
SendClientMessageToAll(-1tmpstring);
    }
    if(!
found) return SendClientMessage(playerid, -1"{ffdd99}Nobody has dealt any damage."); 
Result:

Reply
#2

Anyone? why it doesnt sort from descending , 200 damage should be first and not second.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)