Raised This Month: $ Target: $400
 0% 

server_cmd()


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 09-05-2009 , 09:15   Re: server_cmd()
Reply With Quote #3

Well.. i show you the code:

PHP Code:
#include <amxmodx>

#define ADMIN_CHECK ADMIN_KICK

new maxplayers

public plugin_init()
{
    
register_plugin("Admin Check edited""1.0""OneEyed && Alucard")
    
    
maxplayers get_maxplayers()
    
    
register_clcmd("say""handle_say")
}

public 
handle_say(id)
{
    new 
said[192]
    
read_args(said,192)
    
    if( ( 
containi(said"quien") != -&& containi(said"admin") != -) || contain(said"/admin") != -)
    {
        new 
adminnames[33][32]
        new 
Name[32]
        new 
icountx
        
        get_user_name
(idName31)
        
        for(
<= maxplayers i++)
        {
            if(
is_user_connected(i) )
            {
                if(
get_user_flags(i) & ADMIN_CHECK)
                    
get_user_name(iadminnames[count++], 31)
            }
        }
        
        if(
count 0)
        {
            for(
count x++)
            {
                
server_cmd("amx_msg %s ^"Admins Online:\n%s%s^""Nameadminnames[x], < (count-1) ? "\n":"")
                
server_exec()
            }
        }
        if(
count 0)
        {
            
server_cmd("amx_msg %s ^"No admins online^""Name)
            
server_exec()
        }
    }
    else
        return 
PLUGIN_CONTINUE
    
return PLUGIN_HANDLED

I tested in lan and in a dedicated server. When i have the name with the Admin... and i use /admins command... show me
"Admins Online:
Alucard^"

Good... but when i use a name without the admin... and /admins command... would show me "No admins online". But no... the msg doesn't appear. Is something of flags, or what?

Thx and sry for my english.
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
 



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 15:10.


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