Код:
CMD:admins(playerid,params[])
{
new string[128];
new player[128];
SendClientMessage(playerid,COLOR_MENUHIGHLIGHT, "|---Currently Online Admins---|");
new count;
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PInfo[i][Level] >= 1 && PInfo[i][Level] <= 7)
{
GetPlayerName(i,player,sizeof(player));
format(string,256,"Administrators: %s(%d) - Level %d",player,i,PInfo[playerid][Level]);
SendClientMessage(playerid,COLOR_CYAN,string);
count++;
}
else if(PInfo[i][Level] >= 1 && PInfo[i][Level] <= 7 && PInfo[i][pAdminDuty] == 1)
{
GetPlayerName(i,player,sizeof(player));
format(string,256,"Administrators: %s(%d) - Level %d [ON DUTY]",player,i,PInfo[playerid][Level]);
SendClientMessage(playerid,COLOR_CYAN,string);
count++;
}
}
}
if(count == 0)
{
SendClientMessage(playerid,COLOR_CYAN,"No admins are online.");
}
SendClientMessage(playerid,COLOR_MENUHIGHLIGHT,"|---------------------------------------|");
return 1;
}
You should only activate the first if the admin isn't on duty, otherwise it'll activate nomatter what, and then the next wont.