Advertisement
Guest User

Jnr3 AntiBot v1.1

a guest
Sep 4th, 2013
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.40 KB | None | 0 0
  1. //*********************************************************************
  2. //*                                                                   *
  3. //*                      Sistema Anti Bot by                          *
  4. //*                                                                   *
  5. //                            Juniior3                                *
  6. //*                                                                   *
  7. //*********************************************************************
  8.  
  9. //=============================<[Defines]>=================================
  10.  
  11. #define    Conexoes           4
  12. #define    MaximoNumeros      4
  13.  
  14. //=============================<[Variáveis]>===============================
  15.  
  16.     static
  17.         NumerosNick [ MAX_PLAYERS ] ,
  18.         IPs [ MAX_PLAYERS ] ;
  19.        
  20. new NomesProibidos [ 10 ] [ 2 ] = {
  21.    
  22.     {"0"},
  23.     {"1"},
  24.     {"2"},
  25.     {"3"},
  26.     {"4"},
  27.     {"5"},
  28.     {"6"},
  29.     {"7"},
  30.     {"8"},
  31.     {"9"}
  32. };
  33.  
  34.  
  35. //=============================<[Funções]>=================================
  36.  
  37. Nick ( playerid ) {
  38.    
  39.     static
  40.         Nome [ MAX_PLAYER_NAME ] ;
  41.        
  42.     GetPlayerName ( playerid , Nome , MAX_PLAYER_NAME ) ;
  43.    
  44.     return Nome ;
  45. }
  46.  
  47. NomeDeBot ( playerid ) {
  48.    
  49.     if ( strfind ( Nick ( playerid ) , "[hax]" , true ) != -1 )
  50.         return 1 ;
  51.  
  52.     for ( new i ; i < sizeof ( NomesProibidos ) ; ++ i ) {
  53.        
  54.         if ( strfind ( Nick ( playerid ) , NomesProibidos [ i ] ) ) {
  55.            
  56.             ++ NumerosNick [ playerid ] ;
  57.            
  58.             if ( NumerosNick [ playerid ] >= MaximoNumeros ) {     
  59.                
  60.                 return 1 ;     
  61.             }
  62.         }  
  63.     }
  64.    
  65.     return 0 ;
  66. }
  67.  
  68. VerificarIP ( playerid ) {
  69.    
  70.     static
  71.         IP [ 20 ] ;
  72.        
  73.     GetPlayerIp ( playerid , IP , sizeof IP ) ;
  74.    
  75.     return IP ;
  76. }
  77.  
  78. PassouConexoes ( playerid ) {
  79.            
  80.     for ( new i ; i < MAX_PLAYERS ; ++ i ) {
  81.        
  82.         if ( strcmp ( VerificarIP ( playerid ) , VerificarIP ( i ) , false ) == 0 ) {
  83.            
  84.             ++ IPs [ playerid ] ;
  85.            
  86.             if ( IPs [ playerid ] >= Conexoes ) {
  87.                
  88.                 return 1 ;     
  89.             }      
  90.         }      
  91.     }
  92.    
  93.     return 0 ;
  94. }
  95.  
  96. //*******************************************<[Como Instalar ?]>*************************************************
  97. /*
  98.  
  99. Basta colocar:
  100.  
  101. public OnPlayerConnect ( playerid ) {
  102.  
  103.     if ( NomeDeBot ( playerid ) || PassouConexoes ( playerid ) ) {
  104.    
  105.         PONHA AQUI A PUNIÇÃO PARA O BOT, CASO SEJA ALGUMA VARIÁVEL DO SEU GM! Recomendável: Ban ( playerid )
  106.     }
  107.  
  108. }
  109.  
  110. Caso queira usar alguma função dessa include em seu GM para outra finalidade, fique a vontade!
  111.  
  112. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement