top10
#5

Okay, i show you how it would be pretty

First download this include: https://sampforum.blast.hk/showthread.php?tid=343172

PHP код:
CMD:top10(playeridparams[])
{
    if(
gLogged[playerid] == 0) return SendClientMessage(playeridCOLOR_ERROR"Tu nu esti logat si nu poti sa folosesti aceasta comanda!");
    const 
max_sort 10;
    new 
toSort[MAX_PLAYERS][2], string[16 + (MAX_PLAYER_NAME+3)*max_sort] = "Nume\tOre jucate\n"bool:found;
    for(new 
i=GetPlayerPoolSize(),idx!= -1i--)
    {
        if(!
IsPlayerConnected(i) || IsPlayerNPC(i) || PlayerInfo[i][pHoursPlayed] <= 0) continue;
        
toSort[idx][0] = PlayerInfo[i][pHoursPlayed];
        
toSort[idx++][1] = i;
    }
    
SortDeepArray(toSort0, .order SORT_DESC);
    for(new 
i,n[MAX_PLAYER_NAME]; i<max_sorti++)
    {
        if(
toSort[i][0] == 0) break;
        
found=true;
        
GetPlayerName(toSort[i][1],n,MAX_PLAYER_NAME);
        
format(string,sizeof(string),"%s%s\t%d\n",string,n,toSort[i][0]);
    }
    if(!
found) return SendClientMessage(playeridCOLOR_ERROR"No players where found yet!");
    
ShowPlayerDialog(playerid1337DIALOG_STYLE_TABLIST_HEADERS"Top 10 jucatori activi"string"Iesi""");
    return 
1;

Not tested, but should work
Reply


Messages In This Thread
top10 - by StR_MaRy - 19.09.2016, 18:41
Re: top10 - by oMa37 - 19.09.2016, 19:31
Re: top10 - by Kaliber - 19.09.2016, 19:44
Re: top10 - by StR_MaRy - 19.09.2016, 19:46
Re: top10 - by Kaliber - 19.09.2016, 20:07
Re: top10 - by StR_MaRy - 19.09.2016, 20:10
Re: top10 - by Kaliber - 19.09.2016, 20:11
Re: top10 - by StR_MaRy - 19.09.2016, 20:12
Re: top10 - by Kaliber - 19.09.2016, 20:14
Re: top10 - by StR_MaRy - 19.09.2016, 20:17

Forum Jump:


Users browsing this thread: 1 Guest(s)