LITTE HELP [LuxAdmin]
#4

pawn Код:
dcmd_admins(playerid,params[])
{
    #pragma unused params
    new
        count = 0,
        string[128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if (IsPlayerConnected(i))
        {
            if(AccInfo[i][Level] >= 1 && AccInfo[i][Hide] == 0)
            {
                if(IsPlayerAdmin(i)) AdmRank ="[RCON ADMIN]";
                else
                {
                    switch(AccInfo[i][Level])
                    {
                        case 1: AdmRank = "{EBE710}[CO-MODERATOR]";
                        case 2: AdmRank = "{2E10EB}[MODERATOR]";
                        case 3: AdmRank = "{10EB23}[ADMIN]";
                        case 4: AdmRank = "{EB105D}[LEADER]";
                        case 5: AdmRank = "{EB1F10}[MANAGEMENT]";
                        case 6: AdmRank = "{EB1F10}[FOUNDER]";
                        default: AdmRank = "[FOUNDER]";//Default means all the other
                        //unmentioned case. Since you have checked the player's level
                        //is larger than 1, this means he must be a founder
                        //(unless you have negative level).
                    }
                }
                format(string, 128, "%s{B3C924}%s [ID:%i] | Level: %d - %s\n", string, PlayerName2(i), i, AccInfo[i][Level], AdmRank);
                //We are appending the string, so put %s before any new data is added,
                //and that parameter actually refers to the string itself.
                count++;
            }
        }
    }
    if (count == 0) ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "{AA3333}_________|- ONLINE ADMINS -|___________", "{AA3333}NO ADMINS ONLINE\n{33AA33} ____________", "Close", "");
    else ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "{AA3333}___________|- ONLINE ADMINS -|__________", string, "Close", "");
    //Don't show dialog in a loop, it won't show all the admins continuously.
    //Show it after all the data are ready.
    return 1;
}
Reply


Messages In This Thread
LITTE HELP [LuxAdmin] - by -BadGirl- - 05.12.2011, 03:53
Re: LITTE HELP [LuxAdmin] - by [MG]Dimi - 05.12.2011, 06:46
Re: LITTE HELP [LuxAdmin] - by -BadGirl- - 05.12.2011, 06:56
Re: LITTE HELP [LuxAdmin] - by leong124 - 05.12.2011, 09:02
Re: LITTE HELP [LuxAdmin] - by bestr32 - 15.01.2012, 19:46

Forum Jump:


Users browsing this thread: 1 Guest(s)