SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 31/12/2011, 07:50 PM   #1
HondaCBR
Huge Clucker
 
Join Date: Apr 2011
Posts: 286
Reputation: 0
Default Show all admins online

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 Code:
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..
HondaCBR is offline   Reply With Quote
Old 31/12/2011, 07:57 PM   #2
PlayHard
Huge Clucker
 
PlayHard's Avatar
 
Join Date: Nov 2011
Location: In an apartment
Posts: 216
Reputation: 22
Default Re: Show all admins online

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

pawn Code:
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 Code:
#define adminlevel1 "Trial Admin"
#define adminlevel2 "Junior Admin"
#define adminlevel3 "Major Admin"
#define adminlevel4 "Head Admin"
#define adminlevel5 "Owner"

*Using foreach include .
PlayHard is offline   Reply With Quote
Old 31/12/2011, 08:17 PM   #3
HondaCBR
Huge Clucker
 
Join Date: Apr 2011
Posts: 286
Reputation: 0
Default Re: Show all admins online

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.
HondaCBR is offline   Reply With Quote
Old 05/04/2013, 03:36 AM   #4
KiiD
Big Clucker
 
KiiD's Avatar
 
Join Date: Feb 2012
Location: Australia
Posts: 178
Reputation: 1
Default Re: Show all admins online

Thanks for that, & sorry for the bump :P
__________________
If I helped you, feel free to leave a rep by clicking the little star under my avatar, thankyou.

KiiD is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/admins dialog Total online admins do help:( y@sin1 Scripting Help 10 14/01/2012 04:58 PM
[HELP]/admins <Show current admins online by ID, Name, Rank and Duty> Deal-or-die Help Archive 7 01/06/2011 12:00 PM
Show messages for RCON Admins Gantzyo Help Archive 4 12/09/2010 11:44 AM
How to show a list of all online players? Torran Help Archive 6 10/03/2010 11:19 AM


All times are GMT. The time now is 05:25 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.