Admins rank help.
#6

Quote:
Originally Posted by Skribblez
Посмотреть сообщение
Here's something you could use:
pawn Код:
GetPlayerAdminRank(playerid)
{
    new rankname[32];
   
    switch(PlayerInfo[playerid][pAdminLevel])
    {
        case 1: { rankname = "TITLE HERE"; }
        case 2: { rankname = "TITLE HERE"; }
        case 3: { rankname = "TITLE HERE"; }
        case 4: { rankname = "Owner"; }
        default: { rankname = "Admin"; }
    }
   
    return rankname;
}
Then use this:
pawn Код:
format(string, sizeof(string), "%s%s \n", GetPlayerAdminRank, name);
Here, use this:

pawn Код:
stock GetPlayerAdminRank(playerid)
{
    new rankname[32];
   
    switch(PlayerInfo[playerid][pAdminLevel])
    {
        case 1: { rankname = "TITLE HERE"; }
        case 2: { rankname = "TITLE HERE"; }
        case 3: { rankname = "TITLE HERE"; }
        case 4: { rankname = "Owner"; }
        default: { rankname = "Admin"; }
    }
   
    return rankname;
}
pawn Код:
CMD:admins(playerid, params[])
{
    new count = 1, name[24], string[128];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && PlayerInfo[i][pAdminLevel] != 0)
        {
            GetPlayerName(i, name, sizeof(name));
            format(string, sizeof(string), "%s%s%s \n", string, GetPlayerAdminRank(i), name);
            count ++;
        }
    }

    if(count > 0)
    {
        ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "Online Admins", string, "OK", "");
    }
    else ShowPlayerDialog(playerid, 123, DIALOG_STYLE_MSGBOX, "[!] Online Admins", "No online admins", "OK", "");
}
Please use [ pawn ] [/pawn] instead of [ code ] [ /code ] tag next time. It makes it pawn codes easier to read.
Reply


Messages In This Thread
[Solved]Admins rank help. - by SilentSoul - 28.08.2013, 18:42
Re: Admins rank help. - by Skribblez - 28.08.2013, 19:04
Re: Admins rank help. - by SilentSoul - 28.08.2013, 19:16
Re: Admins rank help. - by Skribblez - 28.08.2013, 19:19
Re: Admins rank help. - by SilentSoul - 28.08.2013, 19:21
Re: Admins rank help. - by ProjectMan - 28.08.2013, 19:23
Re: Admins rank help. - by SilentSoul - 28.08.2013, 19:25
Re: Admins rank help. - by Skribblez - 28.08.2013, 19:32

Forum Jump:


Users browsing this thread: 1 Guest(s)