Quote:
Originally Posted by MP2
pawn Код:
for(new i=0; i<GetMaxPlayers(); i++) { if(!IsPlayerConnected(i)) continue; // Not connected, continue if(!pLevel[i]) continue; // Not admin, continue if(!count) format(string, sizeof(string), "%s", pName[i]); // The first else format(string, sizeof(string), "\n%s", pName[i]); // Not the first, start with \n count++; } if(!count) return ShowPlayerDialog(.. no admins online ..); // No admins, display the 'no admins' dialog and stop the script there (return) ShowPlayerDialog(playerid, dialogid, DIALOG_STYLE_LIST, "Admins Online:", string, "OK", ""); // Script carried on, show list of admins
Rushed, should work though.
|
That won't work as intended, the end result will only be a single administrators name showing. This is because you're simply overwriting the string every time you format it, like I explained earlier, you should look into using strcat.