30.05.2015, 11:33
You still need to show the dialog when the loop ends or else it wont work...
Код:
if(strcmp(cmd, "/admins", true) == 0)
{
if (IsPlayerConnected(playerid))
{
new
string[128],
dialogstring[500];
for(new i = 0; i < GetPlayerPoolSize(); i++)
{
if (!IsPlayerConnected(i))
continue;
if (!PlayerInfo[i][pAdmin])
continue;
if (!PlayerInfo[i][pStealthed])
continue;
new
alevel[30];
switch(PlayerInfo[i][pAdmin])
{
case 1:
alevel = "{951FD0}Probie Admin";
case 2:
alevel = "{00FF0C}Junior Admin";
case 3:
alevel = "{00FF0C}General Admin";
case 4 .. 1335:
alevel = "{F4A460}Senior Admin";
case 1336 .. 99998:
alevel = "{FF0000}Head Admin";
case 99999:
alevel = "Executive Admin";
}
format(string, sizeof(string), "{FFFFFF}[ %s {FFFFFF}] %s\n", alevel, PlayerRPName(i));
strcat(string, dialogstring);
}
ShowPlayerDialog(playerid, 1378, DIALOG_STYLE_LIST, "{FFFFFF}Admins Online", string, "Ok", "");
}
return 1;
}


