25.06.2013, 10:08
Hello. I'm trying to make this command show players that currently have hit on in a dialog, but it only shows one line. It's OK, if I use SendClientMessage(), but I want to show in a dialog! Here's the code:
Any tips for the newb?
pawn Код:
CMD:bounties(playerid, params[])
{
new message1[170];
new bounty = 0;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pContract] > 0)
{
format(message1,sizeof(message1), "ID: %d %s, Bounty: $%d.", i, GetName(i), PlayerInfo[i][pContract]);
bounty++;
strcat(message1, "\n");
}
}
}
if(bounty >= 1)
ShowPlayerDialog(playerid,1337,DIALOG_STYLE_LIST,"Bounties!", message1, "Ok","Close");
if(bounty == 0)
SendClientMessage(playerid, -1, "No bounties at this moment.");
return 1;
}