[ZCMD]Admin online wrong
#1

pawn Код:
CMD:admins(playerid, params[])
{
    new OnlineAdmins = 0;
    new Rank[150];
    new adminstringpro[1208];
    foreach(Player, i)
    {
        if(IsPlayerConnected(i))
        {
            if(PlayerInfo[i][aLevel] >= 5)
            {
                if(IsAdminUnderCover{i} == true)
                {
                    continue;
                }
                else
                {
                    switch(PlayerInfo[i][aLevel])
                    {
                        case 1:
                        {
                            Rank = "No";
                        }
                        case 2:
                        {
                            Rank = "No";
                        }
                        case 3:
                        {
                            Rank = "No";
                        }
                        case 4:
                        {
                            Rank = "No";
                        }
                        case 5:
                        {
                            Rank = "Moderator";
                        }
                        case 6:
                        {
                            Rank = "Server Administrator";
                        }
                        case 7:
                        {
                            Rank = "Trusted Administrator";
                        }
                        case 8:
                        {
                            Rank = "Server Owner";
                        }
                    }
                    format(adminstringpro, sizeof(adminstringpro),"%s%s - [Level:%d] - [ID:%d] - %s", adminstringpro, GetName(i), PlayerInfo[i][aLevel], i, Rank);
                    OnlineAdmins++;
                }
            }
        }
    }
    if(OnlineAdmins == 0)
    {
        ShowPlayerDialog(playerid, 15321, DIALOG_STYLE_MSGBOX, "NVCNR Admin Online List", "No NVCNR Admin Online In the List\n Admins Are Also watching From console And IRC.", "Okay", "");
    }
    ShowPlayerDialog(playerid, 15321,DIALOG_STYLE_MSGBOX, "NVCNR Admin Online List", adminstringpro, "ok", "");
    new astring[500];
    format(astring, sizeof(astring),"%s [%d] typed: /admins", GetName(playerid), playerid);
    SendAdminMessage(GREY, astring);
    return true;
}
there is 2 admin online but it show only 1 please help
Reply
#2

Debug messages.

Also, you don't need to use IsPlayerConnected in foreach. The exact purpose of foreach is to only loop through connected players.
Reply
#3

so can you help me fix it =.= noob at Scripting for now ;\
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)