16.12.2014, 03:27
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;
}