Never return in a loop unless you want to stop it.
PHP код:
dcmd_test(playerid, params[])
{
#pragma unused params
if (InDm[playerid] >= 1) return SendClientMessage(playerid, 0xFF0000FF, "ERROR:You can't use this command in a dm/event.");
new sendername[MAX_PLAYER_NAME], string2[256], count;
for (new i = 0; i < MAX_PLAYERS; i++) //foreach(new i : Player)
{
if (GetPlayerName(i, sendername, sizeof(sendername)) && PlayerInfo[i][Admin] >= 1)
{
format(string2, sizeof (string2), "%s{ff0000}%s{0DF600}[ID: %d] {00E1B8}Level: %d%s\n", string2, sendername, i, PlayerInfo[i][Admin], (IsPlayerAdmin(i)) ? (" {FFBF00}(RCON)") : (""));
++count;
}
}
if (count) ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_LIST, "Admins Online", string2, "Close", "");
else SendClientMessage(playerid, 0xFF0000FF, "No admins online.");
return 1;
}