Advertisement
ColdWar-Pawn

Block 2x IP | Stav

Mar 24th, 2013
531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.76 KB | None | 0 0
  1. /* Plugin generated by AMXX-Studio */
  2.  
  3. #include < amxmodx >
  4.  
  5. new szIP[ 33 ][ 22 ], g_iMaxPlayers;
  6.  
  7. public plugin_init()
  8. {
  9.     register_plugin( "Block 2 IPs", "v1.0", "+ColdWar" );
  10.     g_iMaxPlayers = get_maxplayers( );
  11. }
  12.  
  13. public client_putinserver( client )
  14. {
  15.     get_user_ip( client, szIP[ client ], sizeof szIP[] - 1, 1 );
  16.    
  17.     for( new i = 1 ; i <= g_iMaxPlayers( ) ; i ++ )
  18.     {
  19.         if( !is_user_connected( i ) )
  20.             continue;
  21.        
  22.         if( !equal( szIP[ client ], szIP[ i ] ) )
  23.             continue;
  24.        
  25.         cause_disconnect( client );
  26.         break;
  27.     }
  28. }
  29.  
  30. stock cause_disconnect( client )
  31. {
  32.     message_begin( MSG_ONE_UNRELIABLE, SVC_DISCONNECT, .player = client );
  33.     ewrite_string( "Another computer is connected with the same IP address to this server." );
  34.     message_end( );
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement