/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#if defined CSTRIKE_HASZNALO
new Trie:parancs;
new asd;
#endif
new parancs_kiolvasasa[ ] = { "parancs_blokkolasa.ini" };
public plugin_init( )
{
register_plugin( "Parancs blokkolasa", "1.0", "excitedboy" );
#if defined CSTRIKE_HASZNALO
parancs = TrieCreate( );
#endif
ReadFileData( );
}
#if defined CSTRIKE_HASZNALO
public plugin_end( )
{
TrieDestroy( parancs );
}
public BelsoParancs( id, const szParancs[ ] )
{
if ( TrieKeyExists( parancs, szParancs ) )
{
return PLUGIN_HANDLED;
}
return PLUGIN_CONTINUE;
}
#endif
public ParancsBlokkolasa( id )
{
return PLUGIN_HANDLED;
}
ReadFileData( )
{
new szKonfiguraciosFajl[ 64 ];
get_configsdir( szKonfiguraciosFajl , charsmax( szKonfiguraciosFajl ) );
new szFajlHelye[ 64 ];
formatex( szFajlHelye, charsmax( szFajlHelye ), "%s/%s", szKonfiguraciosFajl, parancs_kiolvasasa );
if ( !file_exists( szFajlHelye ) )
{
set_fail_state( "ini fájl szükséges." );
}
new szAdat[ 191 ];
new szFajl = fopen( szFajlHelye, "rt" );
while ( !feof( szFajl ) )
{
fgets( szFajl, szAdat, charsmax( szAdat ) );
trim( szAdat );
if ( !szAdat[ 0 ] || szAdat[ 0 ] == ';' || szAdat[ 0 ] == '/' && szAdat[ 1 ] == '/' )
{
continue;
}
strtolower( szAdat );
#if defined CSTRIKE_HASZNALO
TrieSetCell( parancs, szAdat, asd );
asd++;
#endif
register_clcmd( szAdat, "ParancsBlokkolasa" );
}
fclose( szFajl );
}