Raised This Month: $ Target: $400
 0% 

add console_print here


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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 02:11.


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