02.03.2015, 08:22
pawn Код:
CMD:admins(playerid, params[])
{
new name[24], string[60], stringend[60*10+1], count; // max 10 admins in dialog.
//..
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(pdata[i][Administrador] >= 1)
{
GetPlayerName(i, name, sizeof(name));
format(string, sizeof(string), "%s (%d): %s\n", name, i, AdminLevel(i));
strcat(stringend, string);
count++;
}
}
}
if(count < 1)
ShowPlayerDialog(playerid, 22, DIALOG_STYLE_MSGBOX, "Online admins", "No players found", "Close","");
else if(count >= 1)
ShowPlayerDialog(playerid, 20, DIALOG_STYLE_LIST, "Online admins", stringend, "Close","");
//..
return true;
}