Admins and MMmembers only shows one admin ..
#1

hello guys so i created a cmd to check online admins and online mm members but it only shows one admin and one member it don't show the rest
codes:
Admins
pawn Код:
CMD:admins(playerid, params[])
{
    new Count = 0, playername[128], string[1400], AdminRank[25];
    for(new i = 0; i < MAX_PLAYERS; i++) //I would recommend foreach.
    {
        if(!IsPlayerConnected(i)) continue;
        switch(PlayerInfo[i][Level])
        {
            case 0: continue;
            case 1: AdminRank = "New Born Admin";
            case 2: AdminRank = "Developer Admin";
            case 3: AdminRank = "Well Get The Job";
            case 4: AdminRank = "Served Enough";
            case 5: AdminRank = "Trusted Admin";
            case 6: AdminRank = "Highly Recommended Admin";
        }
        new fstr[70];
        GetPlayerName(i, playername, sizeof(playername));
        if(PlayerInfo[i][Level] == 6) format(string, 128, "{FF0000}Rank: %d - %s (Id:%i) | %s |", PlayerInfo[i][Level], playername, i, AdminRank);
        else format(string, 128, "Rank: %d - %s (Id:%i) | %s |", PlayerInfo[i][Level], playername, i, AdminRank);
        strcat(string, fstr);
        Count++;
        if(Count >= 20)
        {
            strcat(string, "\n{FF0000}Not all Admins could be listed. (More than 20 online)");
            break;
        }
    }
    if(!Count) string = "{FF0000}There are currently no vips online";
    format(string, sizeof(string), "{FF0000}Online Server Adminstrators\n{FFFFFF}%s", string);
    ShowPlayerDialog(playerid, 12, DIALOG_STYLE_MSGBOX, "{FF0000}CCTDM - Online Admins", string, "OK", "");
    return 1;
}
MM members
pawn Код:
CMD:mmmembers(playerid, params[])
{
    new Count = 0, playername[MAX_PLAYER_NAME], string[1400], MuRank[25];
    for(new i = 0; i < MAX_PLAYERS; i++) //I would recommend foreach.
    {
        if(!IsPlayerConnected(i)) continue; //Remove if using foreach.
        switch(PlayerInfo[i][MMRank])
        {
            case 0: continue;
            case 1: MuRank = "Newest Member";
            case 2: MuRank = "Junior Member";
            case 3: MuRank = "Executive Member";
            case 4: MuRank = "Senior Member";
            case 5: MuRank = "Head Member";
            case 6: MuRank = "Lieutenant";
            case 7: MuRank = "General";
            case 8: MuRank = "Leader";
        }
        new fstr[70];
        GetPlayerName(i, playername, sizeof(playername));
        if(PlayerInfo[i][MMRank] == 8) format(string, 128, "{FF0000}Rank: %d - %s (Id:%i) | %s |", PlayerInfo[i][MMRank], playername, i, MuRank);
        else format(string, 128, "Rank: %d - %s (Id:%i) | %s |", PlayerInfo[i][MMRank], playername, i, MuRank);
        strcat(string, fstr);
        Count++;
        if(Count >= 20)
        {
            strcat(string, "\n{FF0000}Not all MMs could be listed. (More than 20 online)");
            break;
        }
    }
    if(!Count) string = "{FF0000}There are currently no MMs online";
    format(string, sizeof(string), "{FF0000}Online MurderMubsters\n{FFFFFF}%s", string);
    ShowPlayerDialog(playerid, 12, DIALOG_STYLE_MSGBOX, "{FF0000}CCTDM - Online MMs", string, "OK", "");
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)