SA-MP Forums Archive
Top 5 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Top 5 (/showthread.php?tid=550982)



Top 5 - Samjoc18 - 16.12.2014

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;
}



Re: Top 5 - Samjoc18 - 16.12.2014

anyone knows?


Re: Top 5 - Raweresh - 17.12.2014

This should work, maybe at your server is not more then 1 player?


Re: Top 5 - Samjoc18 - 17.12.2014

i tested it with another guy on my server, only id 0 appears on the list :\


Re: Top 5 - Samjoc18 - 26.12.2014

Anyone :/?


Re: Top 5 - Samjoc18 - 29.12.2014

Anyone can help :/?