I actually found a solution whilst waiting for a response, haha, but I think I came up with the same thing as you just said? It's working anyway.
Код HTML:
if (strcmp("/admins", cmdtext, true, 7) == 0)
{
SendClientMessage(playerid, COLOR_PURPLEGRAY, "Administrators:");
new a = 0;
new b = 0;
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if (PlayerInfo[i][pAdmin] == 5)
{
new string[32+MAX_PLAYER_NAME+1];
new adminname[MAX_PLAYER_NAME+1];
GetPlayerName(i, adminname, sizeof(adminname));
format(string, sizeof(string), "Server owner - %s", adminname);
if (Administrator[i] == 1)
{
SendClientMessage(playerid, COLOR_ORANGE, string);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
if (PlayerInfo[i][pAdmin] == 4)
{
new string[32+MAX_PLAYER_NAME+1];
new adminname[MAX_PLAYER_NAME+1];
GetPlayerName(i, adminname, sizeof(adminname));
format(string, sizeof(string), "Senior Administrator - %s", adminname);
if (Administrator[i] == 1)
{
SendClientMessage(playerid, COLOR_ORANGE, string);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
if (PlayerInfo[i][pAdmin] == 3)
{
new string[32+MAX_PLAYER_NAME+1];
new adminname[MAX_PLAYER_NAME+1];
GetPlayerName(i, adminname, sizeof(adminname));
format(string, sizeof(string), "Administrator - %s", adminname);
if (Administrator[i] == 1)
{
SendClientMessage(playerid, COLOR_ORANGE, string);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
if (PlayerInfo[i][pAdmin] > 3)
{
a++;
}
}
}
if (a < 1)
{
SendClientMessage(playerid, COLOR_WHITE, "None");
}
SendClientMessage(playerid, COLOR_PURPLEGRAY, "Moderators:");
for (new i = 0; i < MAX_PLAYERS; i++)
{
if (IsPlayerConnected(i))
{
if (PlayerInfo[i][pAdmin] == 2)
{
new string[32+MAX_PLAYER_NAME+1];
new adminname[MAX_PLAYER_NAME+1];
GetPlayerName(i, adminname, sizeof(adminname));
format(string, sizeof(string), "Moderator - %s", adminname);
if (Administrator[i] == 1)
{
SendClientMessage(playerid, COLOR_ORANGE, string);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
if (PlayerInfo[i][pAdmin] == 1)
{
new string[32+MAX_PLAYER_NAME+1];
new adminname[MAX_PLAYER_NAME+1];
GetPlayerName(i, adminname, sizeof(adminname));
format(string, sizeof(string), "Trial Moderator - %s", adminname);
if (Administrator[i] == 1)
{
SendClientMessage(playerid, COLOR_ORANGE, string);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
if (PlayerInfo[i][pAdmin] < 3)
{
if (PlayerInfo[i][pAdmin] > 0)
{
b++;
}
}
}
}
if (b < 1)
{
SendClientMessage(playerid, COLOR_WHITE, "None");
}
return 1;
}