26.11.2014, 20:40
format the string inside the loop then show the dialog outside the loop, like this;
pawn Код:
CMD:admins(playerid, params[])
{
foreach(Player, i)
{
new string[256], name[MAX_PLAYER_NAME];
GetPlayerName(i, name, sizeof(name));
if(pInfo[i][Adminlevel ] > 0)
{
format(string, sizeof(string), "%s%s %s\n", string, AdminLevelName(playerid), name);
}
}
ShowPlayerDialog(playerid, DIALOG_ONLINE_ADMINS, DIALOG_STYLE_MSGBOX, "Admins online", string, "Close", "");
return 1;
}