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

add console_print here


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BackStats
Senior Member
Join Date: Oct 2008
Old 01-15-2011 , 16:15   add console_print here
Reply With Quote #1

After blocking any command from the list it should display a message on the console player.
Ex: Forbidden command on the server.

PHP Code:
#define USING_CSTRIKE

#include <amxmodx>
#include <amxmisc>
#if defined USING_CSTRIKE
#include <cstrike>

new Trie:g_tCommands;
new 
g_iCount;
#endif

new g_szConfigFileName[ ] = { "commands_blocker.ini" };

public 
plugin_init( )
{
    
register_plugin"Commands Blocker""0.1.1""DruX" );
    
    
#if defined USING_CSTRIKE
    
g_tCommands TrieCreate( );
    
#endif
    
    
ReadFileData( );
}

#if defined USING_CSTRIKE
public plugin_end( )
{
    
TrieDestroyg_tCommands );
}

public 
CS_InternalCommandid, const szCommand[ ] )
{
    if ( 
TrieKeyExistsg_tCommandsszCommand ) )
    {
        return 
PLUGIN_HANDLED;
    }
    return 
PLUGIN_CONTINUE;
}
#endif

public BlockCommandid )
{
    return 
PLUGIN_HANDLED;
}

ReadFileData( )
{
    new 
szConfigsDir64 ];
    
get_localinfo"amxx_configsdir"szConfigsDircharsmaxszConfigsDir ) );
    
    new 
szFilePath64 ];
    
formatexszFilePathcharsmaxszFilePath ), "%s/%s"szConfigsDirg_szConfigFileName );
    
    if ( !
file_existsszFilePath ) )
    {
        
set_fail_state"Customization file needed." );
    }
    
    new 
szData191 ];
    
    new 
fFile fopenszFilePath"rt" );
    
    while ( !
feoffFile ) )
    {
        
fgetsfFileszDatacharsmaxszData ) );
        
        
trimszData );
        
        if ( !
szData] || szData] == ';' || szData] == '/' &&  szData] == '/' )
        {
            continue;
        }
        
        
strtolowerszData );
        
        
#if defined USING_CSTRIKE
        
TrieSetCellg_tCommandsszDatag_iCount );
        
g_iCount++;
        
#endif
        
        
register_clcmdszData"BlockCommand" );
    }
    
    
fclosefFile );

BackStats is offline
fezh
Veteran Member
Join Date: Dec 2008
Location: BANNED
Old 01-15-2011 , 16:43   Re: add console_print here
Reply With Quote #2

Just wondering, why would you want such a thing?
__________________
"There is no knowledge, that is not power"
fezh is offline
BackStats
Senior Member
Join Date: Oct 2008
Old 01-15-2011 , 17:00   Re: add console_print here
Reply With Quote #3

Just wondering.
BackStats is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-15-2011 , 19:36   Re: add console_print here
Reply With Quote #4

So, what's the question? BTW
__________________

Last edited by fysiks; 01-15-2011 at 19:42.
fysiks 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 20:14.


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