ChKo

[ PAWN ] Block Two IP

Nov 23rd, 2015
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.88 KB | None | 0 0
  1. #include < amxmodx >
  2.  
  3. new szIP[ 33 ][ 22 ], g_iMaxPlayers;
  4.  
  5. public plugin_init()
  6. {
  7.         register_plugin( "Block Two IP", "v1.0", "ChKo`" );
  8.         g_iMaxPlayers = get_maxplayers( );
  9. }
  10.  
  11. public client_putinserver( client )
  12. {
  13.     new i;
  14.         get_user_ip( client, szIP[ client ], sizeof szIP[] - 1, 1 );
  15.        
  16.         for( new i = 1 ; i <= g_iMaxPlayers( ) ; i ++ )
  17.         {
  18.                 if( !is_user_connected( i ) )
  19.                         continue;
  20.                
  21.                 if( !equal( szIP[ client ], szIP[ i ] ) )
  22.                         continue;
  23.                
  24.                 cause_disconnect( client );
  25.                 break;
  26.         }
  27. }
  28.  
  29. stock cause_disconnect( client )
  30. {
  31.         message_begin( MSG_ONE_UNRELIABLE, SVC_DISCONNECT, .player = client );
  32.         ewrite_string( "Please Connect With 1 Computer !" );
  33.         message_end( );
  34. }
Advertisement
Add Comment
Please, Sign In to add comment