admins command
#2

I made it in a dialog for you:

First, we define the dialog in the top of the script:
pawn Код:
#define DIALOG_ADMINS 1337
Then we move to the command:
pawn Код:
CMD:admins(playerid,params[])
{
        #pragma unused params
        new count = 0;
        new string[128];
        new fstring[128];
       
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if (IsPlayerConnected(i))
            {
                if(AdminLvl[i] > 0)
                {
                    format(fstring, sizeof(fstring), "{FFFFFF}Admin Level: {00bbff}%d{FFFFFF} - %s(%i)\n",AdminLvl[i], PlayerName(i), i);
                    strcat(string, fstring);
                    count++;
                }
            }
        }
        if (count == 0) return ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "{00bbff}Online Admins", "{FFFFFF}No administrators online.", "Okay","");
        else
        {
            format(fstring, sizeof(fstring), "\r\n{00FF00}Total: {FFFFFF}%d", count);
            strcat(string, fstring);
            ShowPlayerDialog(playerid, DIALOG_ADMINS, DIALOG_STYLE_MSGBOX, "{00bbff}Online Admins", string, "Okay", "");
        }
        return 1;
}
Put this stock at the bottom of the script 'PlayerName':
pawn Код:
stock PlayerName(playerid)
{
  new name[255];
  GetPlayerName(playerid, name, 255);
  return name;
}


EDIT: I made the command in zcmd, if you don't have the incude. Then, download it from here:
https://sampforum.blast.hk/showthread.php?tid=91354
Reply


Messages In This Thread
admins command - by Seaf - 07.06.2014, 23:40
Re: admins command - by iFiras - 07.06.2014, 23:52

Forum Jump:


Users browsing this thread: 1 Guest(s)