HLMOD.HU Forrás Megtekintés - www.hlmod.hu
  1. /* Plugin generated by AMXX-Studio */
  2. #include <amxmodx>
  3. #include <amxmisc>
  4. #include <cstrike>
  5.  
  6. #if defined CSTRIKE_HASZNALO
  7.  
  8. new Trie:parancs;
  9. new asd;
  10. #endif
  11.  
  12. new parancs_kiolvasasa[ ] = { "parancs_blokkolasa.ini" };
  13.  
  14. public plugin_init( )
  15. {
  16. register_plugin( "Parancs blokkolasa", "1.0", "excitedboy" );
  17.  
  18. #if defined CSTRIKE_HASZNALO
  19. parancs = TrieCreate( );
  20. #endif
  21.  
  22. ReadFileData( );
  23. }
  24.  
  25. #if defined CSTRIKE_HASZNALO
  26. public plugin_end( )
  27. {
  28. TrieDestroy( parancs );
  29. }
  30.  
  31. public BelsoParancs( id, const szParancs[ ] )
  32. {
  33. if ( TrieKeyExists( parancs, szParancs ) )
  34. {
  35. return PLUGIN_HANDLED;
  36. }
  37. return PLUGIN_CONTINUE;
  38. }
  39. #endif
  40.  
  41. public ParancsBlokkolasa( id )
  42. {
  43. return PLUGIN_HANDLED;
  44. }
  45.  
  46. ReadFileData( )
  47. {
  48. new szKonfiguraciosFajl[ 64 ];
  49. get_configsdir( szKonfiguraciosFajl , charsmax( szKonfiguraciosFajl ) );
  50.  
  51. new szFajlHelye[ 64 ];
  52. formatex( szFajlHelye, charsmax( szFajlHelye ), "%s/%s", szKonfiguraciosFajl, parancs_kiolvasasa );
  53.  
  54. if ( !file_exists( szFajlHelye ) )
  55. {
  56. set_fail_state( "ini fájl szükséges." );
  57. }
  58.  
  59. new szAdat[ 191 ];
  60.  
  61. new szFajl = fopen( szFajlHelye, "rt" );
  62.  
  63. while ( !feof( szFajl ) )
  64. {
  65. fgets( szFajl, szAdat, charsmax( szAdat ) );
  66.  
  67. trim( szAdat );
  68.  
  69. if ( !szAdat[ 0 ] || szAdat[ 0 ] == ';' || szAdat[ 0 ] == '/' && szAdat[ 1 ] == '/' )
  70. {
  71. continue;
  72. }
  73.  
  74. strtolower( szAdat );
  75.  
  76. #if defined CSTRIKE_HASZNALO
  77. TrieSetCell( parancs, szAdat, asd );
  78. asd++;
  79. #endif
  80.  
  81. register_clcmd( szAdat, "ParancsBlokkolasa" );
  82. }
  83.  
  84. fclose( szFajl );
  85. }