2 in 1 Command List
#5

Quote:
Originally Posted by Andi_Evandy
Посмотреть сообщение
pawn Код:
dcmd_staffs(playerid,params[])
{
    #pragma unused params
    //if(AccInfo[playerid][LoggedIn] != 1) return SendClientMessage(playerid,red,"ERROR: You must be logged in to use this commands");
    //if(AccInfo[playerid][Level] < 1) return ErrorMessages(playerid, 1);
    new count1 = 0, count2 = 0;
    new string[512]; //Because you use Dialog to show "Staff list", you can decrease or increase it.
    strcat(string, "Admins online:\n\n");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && AccInfo[i][Level] >= 1 && AccInfo[i][Hide] == 0)
        {
            if(AccInfo[i][Level] > 5)  AdmRank = "Professional Admin";
            if(IsPlayerAdmin(i)) AdmRank = "RCON Administrator";
            else
            {
                switch(AccInfo[i][Level])
                {
                    case 1: AdmRank = "Basic Moderator";
                    case 2: AdmRank = "Moderator";
                    case 3: AdmRank = "Master Moderator";
                    case 4: AdmRank = "Administrator";
                    case 5: AdmRank = "Master Administrator";
                }
            }
            switch(AccInfo[i][OnDuty])
            {
                case 0: AdmDuty = "Playing!";
                case 1: AdmDuty = "On Duty!";
            }
            format(string, sizeof(string), "%s{A9C4E4}Level: %d - {FFD119}%s (ID:%i) {A9C4E4}| %s | %s\n", string, AccInfo[i][Level], PlayerName2(i), i, AdmRank, AdmDuty);
            count1++;
        }
    }
    if(count1 == 0) strcat(string, "{FFD119}No administrators online{A9C4E4}\n");
    strcat(string, "\nVIP Players online:\n\n");
    for(new vips = 0; vips < MAX_PLAYERS; vips++)
    {
        if(IsPlayerConnected(vips) && AccInfo[vips][pVip] > 0)
        {
            switch(AccInfo[vips][pVip])
            {
                case 1: AccType = "Silver";
                case 2: AccType = "Gold";
                case 3: AccType = "Premium";
            }
            format(string, sizeof(string), "%s{FFD119}%s (ID: %d){A9C4E4} | VIP Type: %s\n", string, PlayerName2(vips), vips, AccType);
            count2++;
        }
    }
    if(count2 == 0) strcat(string, "{FFD119}No players have VIP Account!{A9C4E4}\n");
    ShowPlayerDialog(playerid, 1, DIALOG_STYLE_MSGBOX, "Staffs Online" ,string, "Close", "");
    return 1;
}
Result:
So thats why you're busy huh? XD
Thanks man! you killed it! nice! + REP
Reply


Messages In This Thread
2 in 1 Command List - by kbalor - 16.07.2012, 14:01
Re: 2 in 1 Command List - by Dare Devil..... - 16.07.2012, 14:24
Re: 2 in 1 Command List - by kbalor - 16.07.2012, 14:30
Re: 2 in 1 Command List - by Andi_Evandy - 16.07.2012, 14:46
Re: 2 in 1 Command List - by kbalor - 16.07.2012, 15:03
Re: 2 in 1 Command List - by kbalor - 16.07.2012, 15:10
Re: 2 in 1 Command List - by Andi_Evandy - 16.07.2012, 15:18

Forum Jump:


Users browsing this thread: 4 Guest(s)