Bugged admin cmd
#1

please fix the following and create it that it senses us admins even when we're off duty.


Код:
COMMAND:admins(playerid, params[])
{
        new string[1000];
        foreach(Player, i) {
        if(IsOnDuty[i])
        {
			if(P_Data[i][pAdmin] == 1) { format(string,sizeof(string),""COL_BLUE"Admin %s (%d) - Level 1 (Moderator)",GetName(i), i); }
	        else if(P_Data[i][pAdmin] == 2) { format(string,sizeof(string),""COL_BLUE"Admin %s (%d) - Level 2 (Junior Admin)",GetName(i), i); }
	        else if(P_Data[i][pAdmin] == 3) { format(string,sizeof(string),""COL_BLUE"Admin %s (%d) - Level 3 (Senior Admin)",GetName(i), i); }
	        else if(P_Data[i][pAdmin] == 4) { format(string,sizeof(string),""COL_BLUE"Admin %s (%d) - Level 4 (Lead Admin)",GetName(i), i); }
	        else if(P_Data[i][pAdmin] == 5) { format(string,sizeof(string),""COL_BLUE"Admin %s (%d) - Level 5 (Manager Admin)",GetName(i), i); }
	        else if(P_Data[i][pAdmin] == 6) { format(string,sizeof(string),""COL_BLUE"Admin %s (%d) - Level 6 (Global Admin)",GetName(i), i); }
	        else if(P_Data[i][pAdmin] == 7) { format(string,sizeof(string),""COL_BLUE"Admin %s (%d) - Level 7 (Server Owner)",GetName(i), i); }
	        else return SCM(playerid,-1,""COL_MARONE"-No Administrator Are Online-");
	        SCM(playerid, -1, ""COL_GREEN"|_____________________________________________|");
	        SCM(playerid, -1, ""COL_YELLOW"                 Online Admins");
	        SCM(playerid,-1,string);
			SCM(playerid, -1, ""COL_GREEN"|_____________________________________________|");
		}else return SCM(playerid,-1,""COL_MARONE"-No Administrators Are Online-");
		}
        return 1;
Reward - +1 rep.
Reply
#2

pawn Код:
COMMAND:admins(playerid, params[])
{
    new string[1000], count;
    foreach(Player, i)
    {
        switch (P_Data[i][pAdmin])
        {
            case 1: format(string,sizeof(string),""COL_BLUE"Admin %s (%d) - Level 1 (Moderator)",GetName(i), i);
            case 2: format(string,sizeof(string),""COL_BLUE"Admin %s (%d) - Level 2 (Junior Admin)",GetName(i), i);
            case 3: format(string,sizeof(string),""COL_BLUE"Admin %s (%d) - Level 3 (Senior Admin)",GetName(i), i);
            case 4: format(string,sizeof(string),""COL_BLUE"Admin %s (%d) - Level 4 (Lead Admin)",GetName(i), i);
            case 5: format(string,sizeof(string),""COL_BLUE"Admin %s (%d) - Level 5 (Manager Admin)",GetName(i), i);
            case 6: format(string,sizeof(string),""COL_BLUE"Admin %s (%d) - Level 6 (Global Admin)",GetName(i), i);
            case 7: format(string,sizeof(string),""COL_BLUE"Admin %s (%d) - Level 7 (Server Owner)",GetName(i), i);
            default: continue;
        }
        ++count;
    }
    if (count)
    {
        SCM(playerid, -1, ""COL_GREEN"|_____________________________________________|");
        SCM(playerid, -1, ""COL_YELLOW"                 Online Admins");
        SCM(playerid,-1,string);
        SCM(playerid, -1, ""COL_GREEN"|_____________________________________________|");
    }
    else SCM(playerid,-1,""COL_MARONE"-No Administrators Are Online-");
    return 1;
}
Reply
#3

Thank you very much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)