Top 5
#1

Hi, i found this tutorial on this forums and tried to add it to my server BUT, for some reason it only shows id 0 name/kills/id on the list, can anyone help me solve this! thanks
pawn Код:
CMD:top5(playerid, params[])
{

    new temp;
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        for(new j = i;j<MAX_PLAYERS;++j)
        {
            if(Gkills[j] > Gkills[i])
            {
                temp = Gkills[i];
                Gkills[i] = Gkills[j];
                Gkills[j] = temp;
                temp = scoreid[i];
                scoreid[i] = scoreid[j];
                scoreid[j] = temp;
            }
        }
    }

    new string[5][200];
    for(new i =0;i<5;++i)
    {
        new name[MAX_PLAYER_NAME];
        GetPlayerName(scoreid[i],name,sizeof(name));
        format(string[i],200,"{FFFFFF}%d. {DE1868}%s (ID %d) : {FFFFFF}%d",i+1,name,scoreid[i],Gkills[i]);
    }
    new dstring[300];
    format(dstring,300,"%s\n%s\n%s\n%s\n%s",string[0],string[1],string[2],string[3],string[4]);
    for(new i=0;i<MAX_PLAYERS;++i)
    {
           if(IsPlayerConnected(i))
        {
            ShowPlayerDialog(i,DIALOG_TOP,0,"Top 5",dstring,"OK","");
        }
    }
    return 1;
}
Reply


Messages In This Thread
Top 5 - by Samjoc18 - 16.12.2014, 03:27
Re: Top 5 - by Samjoc18 - 16.12.2014, 23:16
Re: Top 5 - by Raweresh - 17.12.2014, 05:40
Re: Top 5 - by Samjoc18 - 17.12.2014, 13:58
Re: Top 5 - by Samjoc18 - 26.12.2014, 15:11
Re: Top 5 - by Samjoc18 - 29.12.2014, 14:18

Forum Jump:


Users browsing this thread: 1 Guest(s)