09.12.2010, 16:44
ok thx for your code, but i decided to show the bounties with dialog.
now my question, how can I do, that it orders by the largest bounty?!
Example:
#1 Ribber(ID: 3) $ 34000
#2 Player2(ID: 0) $ 30000
#3 Player3(ID: 5) $ 26000
#4 Player4(ID: 1) $ 22000
.....
my code:
now my question, how can I do, that it orders by the largest bounty?!
Example:
#1 Ribber(ID: 3) $ 34000
#2 Player2(ID: 0) $ 30000
#3 Player3(ID: 5) $ 26000
#4 Player4(ID: 1) $ 22000
.....
my code:
pawn Код:
if(strcmp(cmd,"/bounties",true)==0)
{
new amount;
new list[500];
foreach(Player,i)
{
if(bounty[i] > 0)
{
amount++;
format(string,sizeof string,"#%d\t%s(ID: %d)\t $%d\n",amount, PlayerName(i), i, bounty[i]*1000);
strcat(list,string);
}
}
if(amount == 0) return SendClientMessage(playerid,_COLOR_WHITE,"There are not any bounties at the moment.");
else
{
new header[30];
format(header,sizeof(header),"Bounties: %d",amount);
ShowPlayerDialog(playerid,300,DIALOG_STYLE_LIST,header,list,"Close", "Close");
}
return 1;
}