Raised This Month: $ Target: $400
 0% 

Admin Online [HELP]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
keysen
Junior Member
Join Date: Feb 2014
Old 02-25-2014 , 17:20   Admin Online [HELP]
Reply With Quote #1

Hello,
i have a Admin-Online plugin (on menu)
And this plugin write me on the menu only the online admins.
I want that this plugin write me also the offline player

I will explain my self better:
how can i make if there are offline admin from some level (exmple: Co-owner)
So it will write me (on the menu) that admins from this level is offline.

Exmple:
Code:
    if (admin is online) // exmple
    formatex( szFormatExMenu, charsmax( szFormatExMenu ), "%s ( %s )", szName, gAdminGradeNames[ j ] );
                    menu_additem( iMenu, szFormatExMenu, "" );


    else if( admin offline ) // Exmple
    formatex( szFormatExMenu, charsmax( szFormatExMenu ), "no %s online!", gAdminGradeNames[ j ] );
                    
                    menu_additem( iMenu, szFormatExMenu, "" );
Code:
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;

Sorry for bad english :X

Last edited by keysen; 02-25-2014 at 17:25.
keysen is offline
Old 02-27-2014, 15:26
keysen
This message has been deleted by YamiKaitou. Reason: Wait 14 days before you bump
minato
Senior Member
Join Date: May 2010
Location: Rosario
Old 03-02-2014 , 14:42   Re: Admin Online [HELP]
Reply With Quote #2

if you want to display the offline administrator you need to read users.ini and compare if the name is equal from to users is online

example:
PHP Code:

if( equal(nameLoad"admin"// is Online ){
                  // addItem "Admin" - "Co-Owner" - "Online"
}else{
                  
// addItem "Admin" - "Co-Owner" - "Offline"

__________________
minato is offline
Send a message via MSN to minato
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 17:27.


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