Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //*********************************************************************
- //* *
- //* Sistema Anti Bot by *
- //* *
- // Juniior3 *
- //* *
- //*********************************************************************
- //=============================<[Defines]>=================================
- #define Conexoes 4
- #define MaximoNumeros 4
- //=============================<[Variáveis]>===============================
- static
- NumerosNick [ MAX_PLAYERS ] ,
- IPs [ MAX_PLAYERS ] ;
- new NomesProibidos [ 10 ] [ 2 ] = {
- {"0"},
- {"1"},
- {"2"},
- {"3"},
- {"4"},
- {"5"},
- {"6"},
- {"7"},
- {"8"},
- {"9"}
- };
- //=============================<[Funções]>=================================
- Nick ( playerid ) {
- static
- Nome [ MAX_PLAYER_NAME ] ;
- GetPlayerName ( playerid , Nome , MAX_PLAYER_NAME ) ;
- return Nome ;
- }
- NomeDeBot ( playerid ) {
- if ( strfind ( Nick ( playerid ) , "[hax]" , true ) != -1 )
- return 1 ;
- for ( new i ; i < sizeof ( NomesProibidos ) ; ++ i ) {
- if ( strfind ( Nick ( playerid ) , NomesProibidos [ i ] ) ) {
- ++ NumerosNick [ playerid ] ;
- if ( NumerosNick [ playerid ] >= MaximoNumeros ) {
- return 1 ;
- }
- }
- }
- return 0 ;
- }
- VerificarIP ( playerid ) {
- static
- IP [ 20 ] ;
- GetPlayerIp ( playerid , IP , sizeof IP ) ;
- return IP ;
- }
- PassouConexoes ( playerid ) {
- for ( new i ; i < MAX_PLAYERS ; ++ i ) {
- if ( strcmp ( VerificarIP ( playerid ) , VerificarIP ( i ) , false ) == 0 ) {
- ++ IPs [ playerid ] ;
- if ( IPs [ playerid ] >= Conexoes ) {
- return 1 ;
- }
- }
- }
- return 0 ;
- }
- //*******************************************<[Como Instalar ?]>*************************************************
- /*
- Basta colocar:
- public OnPlayerConnect ( playerid ) {
- if ( NomeDeBot ( playerid ) || PassouConexoes ( playerid ) ) {
- PONHA AQUI A PUNIÇÃO PARA O BOT, CASO SEJA ALGUMA VARIÁVEL DO SEU GM! Recomendável: Ban ( playerid )
- }
- }
- Caso queira usar alguma função dessa include em seu GM para outra finalidade, fique a vontade!
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement