I got to this CMD with your help:
pawn Код:
if(strcmp(cmd, "/admins", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
SendClientMessage(playerid, COLOR_GREEN, "_______________Admins_______________");
SendClientMessage(playerid, COLOR_GRAD1, " ");
if(PlayerInfo[i][pAdmin] == 1){ format(string, sizeof(string), "(%d) %s %s", i, AdminRank1, GetPlayerNameEx(i)); }
else if(PlayerInfo[i][pAdmin] == 2){ format(string, sizeof(string), "(%d) %s %s", i, AdminRank2, GetPlayerNameEx(i)); }
else if(PlayerInfo[i][pAdmin] == 3){ format(string, sizeof(string), "(%d) %s %s", i, AdminRank3, GetPlayerNameEx(i)); }
else if(PlayerInfo[i][pAdmin] == 4){ format(string, sizeof(string), "(%d) %s %s", i, AdminRank4, GetPlayerNameEx(i)); }
else if(PlayerInfo[i][pAdmin] == 5){ format(string, sizeof(string), "(%d) %s %s", i, AdminRank5, GetPlayerNameEx(i)); }
else if(PlayerInfo[i][pAdmin] == 6){ format(string, sizeof(string), "(%d) %s %s", i, AdminRank6, GetPlayerNameEx(i)); }
else if(PlayerInfo[i][pAdmin] == 7){ format(string, sizeof(string), "(%d) %s %s", i, AdminRank7, GetPlayerNameEx(i)); }
else if(PlayerInfo[i][pAdmin] == 1337){ format(string, sizeof(string), "(%d) %s %s", i, AdminRank8, GetPlayerNameEx(i)); }
SendClientMessage(playerid, COLOR_GRAD1, string);
SendClientMessage(playerid, COLOR_GRAD1, " ");
SendClientMessage(playerid, COLOR_GREEN, "_____________________________________");
return 1;
}
else if(!IsPlayerConnected(i)){ SendClientMessage(playerid, COLOR_GRAD1, "Unfortunatly there are no admins online"); return 1; }
}
}
return 1;
}
but this happanes:
I'm an admin all works fine
I'm not admin server crashes