SA-MP Forums Archive
Show all admins online - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Show all admins online (/showthread.php?tid=307715)



Show all admins online - HondaCBR - 31.12.2011

Hello, I want to make list of admins command, if you are an admin you are PlayerInfo[playerid][pGmL] >= 1. How can I list every single connected player in a dialog, I thought it will be easy but then I thought how am I going to format each online admin in to different line in the dialog, so I need help.

pawn Код:
if(strcmp(cmd, "/a", true) == 0)
    if(strcmp(cmd, "/a", true) == 0)
    {
        new text12[256];
        new option1[128];
        if(PlayerInfo[playerid][pGmL] >= 1)
        {
            format(option1,sizeof(option1),"%s",WHAT HERE);
            format(text12,sizeof(text12),"%s\n%s",option1,option2);
            ShowPlayerDialog(playerid, 0504, DIALOG_STYLE_LIST, "Admins:", text12, "", "Ok");
        }
    }
And the thing im struggling with is that it needs to be global, I cant use PlayerInfo[playerid], insted of palyerid it needs to check, so can someone help me do this..


Re: Show all admins online - PlayHard - 31.12.2011

I'll give you the one in my script and study it . I use YCMD!

pawn Код:
YCMD:admins(playerid, params[])
{
    if(gPlayerLoggedIn[playerid] == 0) return 1;

    SendClientMessage(playerid, 0x1FFFFFF, "Administrators online:");
    foreach(Player, i)
    {
        new level[128], string[128];

        if(PlayerInfo[i][Admin] > 0)
        {
            switch(PlayerInfo[i][Admin])
            {
                case 1: level = ""adminlevel1" (1)";
                case 2: level = ""adminlevel2" (2)";
                case 3: level = ""adminlevel3" (3)";
                case 4: level = ""adminlevel4" (4)";
                case 5: level = ""adminlevel5" (5)";
            }
            format(string, sizeof(string), "%s %s", level, PlayerName(i));
            SendClientMessage(playerid, 0xFFF84FFFF, string);
        }
    }
    return 1;
}
pawn Код:
#define adminlevel1 "Trial Admin"
#define adminlevel2 "Junior Admin"
#define adminlevel3 "Major Admin"
#define adminlevel4 "Head Admin"
#define adminlevel5 "Owner"
*Using foreach include .



Re: Show all admins online - HondaCBR - 31.12.2011

I guess I could make one using text, but the one I want is using dialogs, And I don't know how to format it and how many formats to do as I dont know how many admins will be online.


Re: Show all admins online - KiiD - 05.04.2013

Thanks for that, & sorry for the bump :P