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

Show listip / listid via amx_command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 05-22-2013 , 15:50   Show listip / listid via amx_command
Reply With Quote #1

Hello!
Is this possible?
Ex.: amx_listip, amx_listid in console:

123.123.123.123
123.123.123.124
123.123.123.125 from listip.cfg

STEAM_0:0:00000001
STEAM_0:0:00000002 from banned.cfg
etc
__________________
sorry my bad english...
alonelive is offline
alonelive
Senior Member
Join Date: Jan 2011
Location: Big snow country.. :)
Old 05-23-2013 , 02:40   Re: Show listip / listid via amx_command
Reply With Quote #2

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

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_concmd("amx_listip""cmdListIP"ADMIN_BAN)
    
register_concmd("amx_listid""cmdListID"ADMIN_BAN)
}


public 
cmdListIP(idlevelcid)
{
    if (!
cmd_access(idlevelcid1))
    return 
PLUGIN_HANDLED
    
    
new filename[32]
    
format(filename31"../listip.cfg")
    
    if( !
file_exists(filename) )  
    {
        
server_print("BAN list %s is empty or does not exist.",filename)
    }
    else
    {
        new 
fp fopen(filename,"a+")
        
// read from file listip.cfg
        
fclose(fp)
        
// console_print(id, data from file...
        // and show list in console
    
}
    return 
PLUGIN_CONTINUE
}
    
public 
cmdListId(idlevelcid)
{
    if (!
cmd_access(idlevelcid1))
    return 
PLUGIN_HANDLED
    
    
new filename[32]
    
format(filename31"../banned.cfg")
    
    if( !
file_exists(filename) )  
    {
        
server_print("BAN list %s is empty or does not exist.",filename)
    }
    else
    {
        new 
fp fopen(filename,"a+")
        
// read from file banned.cfg
        
fclose(fp)
        
// console_print(id, data from file...
        // and show list in console
    
}
    return 
PLUGIN_CONTINUE

1. Help me with this, please..
2. How many bans (rows) i can see in console? 128? 512? 2048?
3. Can i get overflow_gatagram error or server crash in case of count of bans is too large? If yes, can i prevent this?
__________________
sorry my bad english...

Last edited by alonelive; 05-23-2013 at 02:45.
alonelive 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 16:48.


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