Raised This Month: $51 Target: $400
 12% 

Admins Online [Menu List]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TedMan
Senior Member
Join Date: Oct 2012
Old 01-07-2013 , 04:28   Admins Online [Menu List]
Reply With Quote #1

PHP Code:
#include <amxmodx>
#include <amxmisc>

new g_max_clients;

public 
plugin_init()
{
    
register_plugin("Admins Online Menu""0.1""Exolent");
    
    
register_clcmd("say /admins""CmdAdmins");
    
    
g_max_clients get_maxplayers();
}

public 
CmdAdmins(client)
{
    
ShowMainMenu(client);
}

ShowMainMenu(client)
{
    new 
menu menu_create("Admins In Server:""MenuSelect");
    
    new 
bool:admins_in_server false;
    
    new 
name[32];
    for( new 
1<= g_max_clientsi++ )
    {
        if( !
is_user_connected(i) ) continue;
        if( !
is_user_admin(i) ) continue;
        
        
get_user_name(inamesizeof(name) - 1);
        
        
menu_additem(menuname"");
        
        
admins_in_server true;
    }
    
    if( 
admins_in_server )
    {
        
menu_display(clientmenu);
    }
    else
    {
        
client_print(clientprint_chat"There are no admins online at this time.");
        
        
menu_destroy(menu);
    }
}

public 
MenuSelect(clientmenuitem)
{
    
menu_destroy(menu);

I've found this plugin that show admins online. You can add some groups (such as Owner, Moderator, Administrator and show them in menu. Like in this plugin :

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN            "ULTIMATE WHO"
#define VERSION            "1.1"
#define AUTHOR            "P.Of.Pw"

#define CharsMax(%1)        sizeof %1 - 1
#define time_shower        1.0

#define GROUPS_NAME        4
#define GROUPS_ACCESS        4

#define RRR            255
#define GGG            255
#define BBB            255
#define time_hud        12.0

#define motd_msg        "Admin's Online"

#define who_meniu_ad_group_msg    "\y-=[Admin's]=- \r-=[Online]=-^n"
#define who_meniu_admin_msg    "\y-=[Admin's]=- \w-=[Online]=-^n^n"

#define who_meniu_ad_group_msg_bottom    "^n\wPt a esi apasati \y0 \w sau \y5"
#define who_meniu_admin_msg_bottom    "^n\wPt a esi apasati \r0 \w sau \r5"

#define    who_console_top        "=========== Admini Online ==========="
#define    who_console_bottom     "================================"

new GroupNames[GROUPS_NAME][] = {
    
"Owners",
    
"Moderatori",
    
"Administratori",
    
"Sloturi"
}

new 
GroupFlags[GROUPS_ACCESS][] = {
    
"abcdefghijklmnopqrstu",
    
"abcdefghijklmnopqrst",
    
"bcdefijmnopqrstu",
    
"b"
}

new 
GroupFlagsValue[GROUPS_NAME]

new 
who_typewho_typemeniuwho_typtable

public plugin_init() 
{
   
    
register_plugin(PLUGINVERSIONAUTHOR)
   
    for(new 
p_of_pw p_of_pw GROUPS_NAME p_of_pw++)
        
GroupFlagsValue[p_of_pw] = read_flags(GroupFlags[p_of_pw])
   
    
register_clcmd("say""cmdSay")
    
register_clcmd("say_team""cmdSay")
    
    
who_type    register_cvar("cmd_who","1")
    
who_typemeniu    register_cvar("who_typemeniu","1")
    
who_typtable    register_cvar("who_typetable","2")
}

public 
cmdSay(id)
{
    new 
say[192]
    
read_args(say,192)
    if(( 
containi(say"who") != -|| containi(say"admin") != -|| containi(say"admins") != -1  || contain(say"/who") != -|| contain(say"/admin") != -|| contain(say"/admins") != -1))
        
set_task(time_shower,"cmdULTMWho",id)
    return 
PLUGIN_CONTINUE
}

public 
cmdULTMWho(id)
{
    switch(
get_pcvar_num(who_type))
    {
        case 
1who_meniu(id)
        
        case 
2who_motd(id)
        
        case 
3who_table(id)
        
        case 
4who_hud(id)
        
        case 
5who_console(id)
        
    }
    return 
0
}

who_meniu(id)
{
    switch(
get_pcvar_num(who_typemeniu))
    {
        case 
1who_meniu_admin_groups(id)
        
        case 
2who_meniu_admin(id)
    }
    return 
0
}
who_meniu_admin_groups(id)
{
    new 
sPlayers[32], iNumiPlayer
    
new sName[32]
    new 
szMenu[256], nLenkeys
    
    nLen 
format(szMenu[nLen], 255who_meniu_ad_group_msg)
    
get_players(sPlayersiNum"ch")
   
    for(new 
p_of_pw 0p_of_pw GROUPS_NAME p_of_pw++)
    {   
        
nLen += format(szMenu[nLen], 255-nLen,"\r%s^n"GroupNames[p_of_pw])
     
        for(new 
0iNum a++)
        {   
            
iPlayer sPlayers[a]
         
            if(
get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw])
            {
                
get_user_name(iPlayersNamesizeof sName 1)
                
nLen += format(szMenu[nLen], 255-nLen,"\w%s^n"sName)
            }   
        }
    }
    
nLen += format(szMenu[nLen], 255-nLenwho_meniu_ad_group_msg_bottom)
    
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<9)
    
show_menu(id,keys,szMenu,-1)
    return 
0
}

who_meniu_admin(id)
{
    new 
sPlayers[32], iNumiPlayer
    
new sName[32]
    new 
szMenu[256], nLenkeys
   
    nLen 
format(szMenu[nLen], 255who_meniu_admin_msg)
  
    
get_players(sPlayersiNum"ch")
    for(new 
p_of_pw 0p_of_pw GROUPS_NAME p_of_pw++)
    {
        for(new 
0iNum a++)
        {   
            
iPlayer sPlayers[a]
         
            if(
get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw])
            {
                
get_user_name(iPlayersNamesizeof sName 1)
                
nLen += format(szMenu[nLen], 255-nLen,"\r%s^n"sName)
            }   
        }
    }
    
nLen += format(szMenu[nLen], 255-nLenwho_meniu_admin_msg_bottom)
    
keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<9)
    
show_menu(id,keys,szMenu,-1)
    return 
0
}

who_motd(id)
{
    new 
sPlayers[32], iNumiPlayer
    
new sName[32], sBuffer[1024]
    new 
iLen
    
    iLen 
formatex(sBuffersizeof sBuffer 1"<body bgcolor=#000000><font color=#7b68ee><pre>")
   
    
get_players(sPlayersiNum"ch")
   
    for(new 
p_of_pw 0p_of_pw GROUPS_NAME p_of_pw++)
    {   
        
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<center><h5><font color=^"red^">%s^n</font></h5></center>"GroupNames[p_of_pw])
     
        for(new 
0iNum a++)
        {   
            
iPlayer sPlayers[a]
         
            if(
get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw])
            {
                
get_user_name(iPlayersNamesizeof sName 1)
                
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<center>%s^n</center>"sName)
            }
        }        
    }
    
show_motd(idsBuffermotd_msg)
    return 
0

}

who_table(id)
{
    switch(
get_pcvar_num(who_typtable))
    {
        case 
1table_style_one(id)
        
        case 
2table_style_two(id)
    }
    return 
0
}
table_style_one(id)
{
    new 
sPlayers[32], iNumiPlayer
    
new sName[32], sBuffer[1024]
    new 
iLen
    
    iLen 
formatex(sBuffersizeof sBuffer 1"<body bgcolor=#000000><font color=#7b68ee><pre>")
    
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<center><h3><b><font color=^"red^">NUME            -    ACCES</font></h3></b></center>")
    
    
get_players(sPlayersiNum"ch")
   
    for(new 
p_of_pw 0p_of_pw GROUPS_NAME p_of_pw++)
    {
        for(new 
0iNum a++)
        {   
            
iPlayer sPlayers[a]
        
            if(
get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw])
            {
                
get_user_name(iPlayersNamesizeof sName 1)
                
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<center><h4><font color=^"white^">%s        %s^n</font></h4></center>"sNameGroupNames[p_of_pw])
            }
        }        
    }
    
show_motd(idsBuffermotd_msg)
    return 
0
}
table_style_two(id)
{
    new 
sPlayers[32], iNumiPlayer
    
new sName[32], sBuffer[1024]
    new 
iLen
    
    iLen 
formatex(sBuffersizeof sBuffer 1"<body bgcolor=#000000><font color=#7b68ee><pre>")
    
    
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<html><head><title>a</title></head>")
    
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<br><br><center><body><table border>")
    
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<tr><td><h3><b><font color=^"red^">NUME</td><td></h3></b> <h3><b><font color=^"red^">ACCES</td></h3></font></b></center>")
    
    
get_players(sPlayersiNum"ch")
   
    for(new 
p_of_pw 0p_of_pw GROUPS_NAME p_of_pw++)
    {
        for(new 
0iNum a++)
        {   
            
iPlayer sPlayers[a]
        
            if(
get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw])
            {
                
get_user_name(iPlayersNamesizeof sName 1)
                
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"<center><tr><td><h4><b><font color=^"white^">%s<td></b></h4> <h4><b><font color=^"white^">%s </td></h4></font></b></center>"sNameGroupNames[p_of_pw])
            }
        }        
    }
    
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"</table></body></html>")
    
show_motd(idsBuffermotd_msg)
    return 
0
}

who_hud(id)
{
    new 
sPlayers[32], iNumiPlayer
    
new sName[32], sBuffer[1024]
    new 
iLen
    
    get_players
(sPlayersiNum"ch")
   
    for(new 
p_of_pw 0p_of_pw GROUPS_NAME p_of_pw++)
    {   
        
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"=== %s ===^n"GroupNames[p_of_pw])
     
        for(new 
0iNum a++)
        {   
            
iPlayer sPlayers[a]
         
            if(
get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw])
            {
                
get_user_name(iPlayersNamesizeof sName 1)
                
iLen += formatex(sBuffer[iLen], CharsMax(sBuffer) - iLen"%s^n"sName)
            }
        }        
    }
    
set_hudmessage(RRRGGGBBB0.020.2406.0time_hud)
    
show_hudmessage(idsBuffer)
    return 
0
}

who_console(id)
{
    new 
sPlayers[32], iNumiPlayer
    
new sName[32]

    
get_players(sPlayersiNum)
    
console_print(idwho_console_top)
    for(new 
p_of_pw 0p_of_pw GROUPS_NAMEp_of_pw++) 
    {
        for(new 
0iNum a++)
        {
            
            
iPlayer sPlayers[a]
            
get_user_name(iPlayersNamesizeof sName 1)
            if(
get_user_flags(iPlayer) == GroupFlagsValue[p_of_pw]) 
                
console_print(id"= %d = %s : %s"p_of_pw+1GroupNames[p_of_pw], sName)
            
            
        }
    }
    
console_print(idwho_console_bottom)
    return 
0

I posted the second plugin to understand what i want. Basically I want to see Admins online as follows:
PHP Code:
ADMINS NAME GROUP 
If my admin name is Ted and i have the acces flags (in users.ini) 'abcdefghijklmnopqrstu' the plugin must show me in menu like this :

PHP Code:
Ted Owner 

Last edited by TedMan; 01-07-2013 at 04:29.
TedMan is offline
Swisa
Senior Member
Join Date: Nov 2010
Location: Israel
Old 01-07-2013 , 15:06   Re: Admins Online [Menu List]
Reply With Quote #2

PHP Code:
#include <amxmodx>
#include <amxmisc>

new g_max_clients;

new 
GroupFlags[3][] = 
{
    
"abcdefghijklmnopqrstu",
    
"abcdefghijklmnopqrst",
    
"bcdefijmnopqrstu"
}

public 
plugin_init()
{
    
register_plugin("Admins Online Menu""0.1""Exolent");
    
    
register_clcmd("say /admins""CmdAdmins");
    
    
g_max_clients get_maxplayers();
}

public 
CmdAdmins(client)
{
    
ShowMainMenu(client);
}

ShowMainMenu(client)
{
    new 
menu menu_create("Admins In Server:""MenuSelect");
    
    new 
bool:admins_in_server false;
    
    new 
name[32];
    for( new 
1<= g_max_clientsi++ )
    {
        if(
get_user_flags(i) == read_flagsGroupFlags[0] ))
        {
            new 
owner[124]
        
get_user_name(inamesizeof(name) - 1);
        
format(owner,123,"%s | Owner",name)  
        
menu_additem(menuowner"");
        
admins_in_server true;
        }
        else if(
get_user_flags(i) == read_flagsGroupFlags[1] ))
        {
            new 
moderator[124]
        
get_user_name(inamesizeof(name) - 1);
        
format(moderator,123,"%s | Moderator",name)  
        
menu_additem(menumoderator"");
        
admins_in_server true;
        }
        else if(
get_user_flags(i) == read_flagsGroupFlags[2] ))
        {
            new 
administrator[124]
        
get_user_name(inamesizeof(name) - 1);
        
format(administrator,123,"%s | Administrator",name)  
        
menu_additem(menuadministrator"");
        
admins_in_server true;
        }
    }
    
    if( 
admins_in_server )
    {
        
menu_display(clientmenu);
    }
    else
    {
        
client_print(clientprint_chat"There are no admins online at this time.");
        
        
menu_destroy(menu);
    }
}

public 
MenuSelect(clientmenuitem)
{
    
menu_destroy(menu);

try...
__________________
Matcher 100%[Private]
Contact me for buying plugins above!
email : [email protected]
Swisa is offline
Send a message via Skype™ to Swisa
TedMan
Senior Member
Join Date: Oct 2012
Old 01-07-2013 , 15:11   Re: Admins Online [Menu List]
Reply With Quote #3

I didn't ask this...
I don't want to show 'Owner' to all admins..

Here an example ...
PHP Code:
new GroupNames[GROUPS_NAME][] = {
    
"Owners",
    
"Moderatori",
    
"Administratori",
    
"Sloturi"
}

new 
GroupFlags[GROUPS_ACCESS][] = {
    
"abcdefghijklmnopqrstu",
    
"abcdefghijklmnopqrst",
    
"bcdefijmnopqrstu",
    
"b"

PHP Code:
"Owners"show if he had the following flags in users.ini -. "abcdefghijklmnopqrstu"
TedMan is offline
TedMan
Senior Member
Join Date: Oct 2012
Old 01-08-2013 , 16:30   Re: Admins Online [Menu List]
Reply With Quote #4

Can you make it to work for more groups ?

Rank1,2,3 etc is the name of the rank and the abcd, etc is the flags of the rank. Hope you understand

PHP Code:
Rank1 -> "abcdefghijklmnopqrstu"
    
Rank2 -> "abcdefghijkmnoprstu"
    
Rank3 -> "abcdefgijlmnortu"
    
Rank4 -> "bcdefgijmnptu"
    
Rank5 -> "bcdefijmonpt"
    
Rank6 -> "bcdefijmnpt"
    
Rank7 ->"bcdefijmnt"
    
Rank8 -> "bcefijt" 
Damn.. i forgot to use 'Edit' button ... sorry

Last edited by TedMan; 01-08-2013 at 16:32.
TedMan is offline
tuty
Veteran Member
Join Date: Jul 2008
Location: UK
Old 01-08-2013 , 16:36   Re: Admins Online [Menu List]
Reply With Quote #5

use mine, as example, i made this 2 years ago

PHP Code:

#include < amxmodx >
#include < amxmisc >
#include < colorchat >

#define    MAX_GRADES    8
#define MAX_PLAYERS    32 + 1

new const gAdminFlagsMAX_GRADES ][ ] = 
{
    
"abcdefghijklmnopqrstu",
    
"abcdefghijklmnopqrst",
    
"bcdefghijklmnopqrst",
    
"bcdefghijlmnopqrst",
    
"bcdefgijlmnopqr",
    
"bcdefgijmnop",
    
"bcefijmno",
    
"b"
};

new const 
gAdminGradeNamesMAX_GRADES ][ ] =
{
    
"Owner",
    
"Co-Owner",
    
"Maresal",
    
"General",
    
"Colonel",
    
"Maior",
    
"Sergent",
    
"Slot"
};

new const 
gTag[ ] = "[FUN WD]";

new 
gMaxPlayers;

public 
plugin_init()
{
    
register_plugin"Admins Online Menu""0.1""Exolent / tuty" );
    
    
register_clcmd"say_team /admins""CmdAdmins" );
    
register_clcmd"say /admins""CmdAdmins" );
    
register_clcmd"say /admin""CmdAdmins" );
    
register_clcmd"say_team /admin""CmdAdmins" );
    
register_clcmd"say /who""CmdAdmins" );
    
register_clcmd"say_team /who""CmdAdmins" );
    
    
gMaxPlayers get_maxplayers( );
}

public 
CmdAdminsclient )
{
    
ShowMainMenuclient );
}

public 
ShowMainMenuclient )
{
    new 
iMenu menu_create"\yAdmini Online:""MenuSelect" );
    
    new 
bool:bAdminsInServer false;
    
    new 
szName32 ], ijszFormatExMenu3000 ];

    for( 
1<= gMaxPlayersi++ )
    {
        if( 
is_user_bot) )
        {
            continue;
        }

        
get_user_nameiszNamecharsmaxszName ) );

        for( 
0MAX_GRADESj++ )
        {
            if( 
is_user_connected) )
            {
                if( 
get_user_flags) == read_flagsgAdminFlags] ) )
                {
                    
formatexszFormatExMenucharsmaxszFormatExMenu ), "\w%s \d(%s)"szNamegAdminGradeNames] );
                    
                    
menu_additemiMenuszFormatExMenu"" );
                
                    
bAdminsInServer true;
                }
            }
        }
    }
    
    if( 
bAdminsInServer )
    {
        
menu_displayclientiMenu );
    }

    else
    {
        
ColorChatclientRED"^3%s^1 Nu sunt admini online!"gTag );
        
        
menu_destroyiMenu );
    }
}

public 
MenuSelectclientmenuitem )
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroymenu );
        
        return 
PLUGIN_HANDLED;
    }
    
    
menu_displayclientmenu );
    
    return 
PLUGIN_HANDLED;

__________________

Last edited by tuty; 01-08-2013 at 16:39.
tuty is offline
Send a message via ICQ to tuty Send a message via AIM to tuty
quilhos
Veteran Member
Join Date: Jun 2010
Old 01-08-2013 , 16:40   Re: Admins Online [Menu List]
Reply With Quote #6

Thanks tuty for sharing
__________________
ELO RATING SYSTEM - SQL [COMPLETE]
Quote:
Originally Posted by Liverwiz View Post
DDDRRRRAAAAMMMMAAAAA!!!???

Put this shit on pause while i go get some popcorn!!
quilhos is offline
dbs1989
Member
Join Date: Dec 2010
Location: Denmark
Old 01-09-2013 , 10:19   Re: Admins Online [Menu List]
Reply With Quote #7

Can you make it so it find the group from admin_groups.ini instead of the flags?
__________________
dbs1989 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 01-09-2013 , 10:23   Re: Admins Online [Menu List]
Reply With Quote #8

Quote:
Originally Posted by dbs1989 View Post
Can you make it so it find the group from admin_groups.ini instead of the flags?
What is in admin_groups.ini? What plugin uses it?
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
TedMan
Senior Member
Join Date: Oct 2012
Old 01-10-2013 , 06:51   Re: Admins Online [Menu List]
Reply With Quote #9

Quote:
Originally Posted by tuty View Post
use mine, as example, i made this 2 years ago
Works 10x
TedMan is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 19:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode