Advertisement
ColdWar-Pawn

Block Players

Nov 18th, 2012
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.10 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include <amxmodx>
  4.  
  5. new const plugin_info[3][] = {
  6.     "Block Players",
  7.     "v0.1",
  8.     "+ColdWar"
  9. };
  10.  
  11. public plugin_init() {
  12.     register_plugin( plugin_info[ 0 ] , plugin_info[ 1 ] , plugin_info[ 2 ] )
  13. }
  14. public client_putinserver( client )
  15. {
  16.     new szText[100], szLine[100], vAuth[35];
  17.     get_user_authid( client , vAuth , sizeof vAuth - 1 );
  18.     _set_format( "blocked_players" , szText , sizeof szText - 1 ) ;
  19.     if( !file_exists( szText ) )
  20.     {
  21.         write_file( szText , "// Write Blocked Players" , 0 );  
  22.         return 0;
  23.     }
  24.     new iFile = fopen( szText , "rt" );
  25.     while( ! feof( iFile ) )
  26.     {
  27.         fgets( iFile , szLine , sizeof szLine - 1 );
  28.         if( equali( szText , "//" , 2 ) )
  29.             continue;
  30.         if( equali( vAuth , szLine ) )
  31.         {
  32.             server_cmd( "kick #%i You are blocked from that server!", get_user_userid( client ) )
  33.             break;
  34.         }
  35.     }
  36.     return 0;
  37. }
  38. stock _set_format( g_FileName[] , g_TargetString[] , maxlen )
  39. {
  40.     new g_DataDir[200];
  41.     get_localinfo( "amxx_datadir" , g_DataDir , sizeof g_DataDir - 1 );
  42.     format( g_TargetString , maxlen , "%s/%s.ini", g_DataDir , g_FileName )
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement