/admins only shows 1 admin online.
#1

The below dialog, only shows 1 admin online when you type /admins.

This is the string.
pawn Код:
new string[128];
This is the code.

pawn Код:
format(string, 128, "{FFFFFF}Level: {FFFF00}%d{FF0000} - %s (Id:%i) {FF0000}| %s | %s",AccInfo[i][Level], PlayerName2(i),i,AdmRank,AdmDuty);
                    count++;
                    ShowPlayerDialog(playerid, DIALOG_ADMIN, DIALOG_STYLE_MSGBOX, "{FF0000}Currently Online Admins", string, "Ok", "");
                }
            }
        }
        if (count == 0)
        ShowPlayerDialog(playerid, DIALOG_ADMIN, DIALOG_STYLE_MSGBOX, "{FF0000}Currently Online Admins", "{FF0000}No admins are currently online", "Ok", "");
        return 1;
}

The exact same happens for /vips.

pawn Код:
format(string, sizeof(string),"{FFFFFF}VIP Level - {FFFF00}%d: {FF0000}%s ", AccInfo[playerid][pVip],name);
count++;
ShowPlayerDialog(playerid, DIALOG_VIP, DIALOG_STYLE_MSGBOX, "{FF0000}Currently Online VIP's", string, "Ok", "");
}
}
}
if(count == 0) {
ShowPlayerDialog(playerid, DIALOG_VIP, DIALOG_STYLE_MSGBOX, "{FF0000}Currently Online VIP's", "{FF0000}No VIP's are currently online", "Ok", "");
}
return 1;
}
Reply
#2

pawn Код:
foreach ( new i : Player )
{
   new st[140], t_st[40];
   if( AccInfo[i][Level] > 0 )
   {
     format(t_st, 40, "%s - Level %d\n", PlayerName2(i), AccInfo[i][Level]);
     strcat(st, t_st);
   }
   else continue;
}
ShowPlayerDialog ( st, ... );
Reply
#3

In your case would in not be better to put new statements under the if parameter? - Rajat Pawar
Reply
#4

Its From My Admin System This Might Help..

pawn Код:
CMD:admins(playerid,params[])
{
    new bool:First2 = false;
    new Count, i;
    new string[256];
    new adminname[MAX_PLAYER_NAME];
    for(i = 0; i < MAX_PLAYERS; i++)
    if(IsPlayerConnected(i) && pInfo[i][Admin] > 0)
    Count++;

    if(Count == 0)
    return ShowPlayerDialog(playerid,9000,DIALOG_STYLE_MSGBOX,"Admins Online","{FF0000}No Admins Online!","Ok","Back");

    for(i = 0; i < MAX_PLAYERS; i++)
    if(IsPlayerConnected(i) && pInfo[i][Admin] > 0)
    {
        if(pInfo[i][Admin] > 0)
        {
            switch(pInfo[i][Admin])
            {
                case 1: AdmRank = "Co - Operator";
                case 2: AdmRank = "Operator";
                case 3: AdmRank = "Co-Moderator";
                case 4: AdmRank = "Moderator";
                case 5: AdmRank = "Co - Owner";
                case 6: AdmRank = "Owner";
            }
        }
        GetPlayerName(i, adminname, sizeof(adminname));
        if(!First2)
        {
            format(string, sizeof(string), "\t\t{00FF00}Admins Online\n{FFFFFF}_________________________________________\n{CCCCCC}%s\t\t\t{FFFFFF}[%s]", Playername(i),AdmRank);
            First2 = true;
        }
        else format(string,sizeof(string),"%s\n{CCCCCC}%s\t\t\t{FFFFFF}[%s]",string,Playername(i),AdmRank);
    }
    return ShowPlayerDialog(playerid,9000,DIALOG_STYLE_MSGBOX,"Admins Online",string,"Ok","Back");
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)