Mensajes: 242
Temas: 106
Registro en: Apr 2020
Reputación:
0
que tal uso REHDLS con amxx 1.9
estoy teniendo problemas que entran y tiran IP en el say.
y tambien se conectan con un tag que tiene una IP
necesito un plugin efectivo que los saque o banee por x tiempo.
Mensajes: 17
Temas: 2
Registro en: May 2016
Reputación:
0
15/02/2021, 02:44 PM
(Última modificación: 15/02/2021, 02:47 PM por -T-E-R-M-I- .)
(15/02/2021, 11:21 AM) cahervar escribió: que tal uso REHDLS con amxx 1.9
estoy teniendo problemas que entran y tiran IP en el say.
y tambien se conectan con un tag que tiene una IP
necesito un plugin efectivo que los saque o banee por x tiempo.
Funciona y compila bien, si te da algún error checa los include que puede que te falten.
Código PHP:
#include <amxmodx> #include <fakemeta> #include <regex> #define PATTERN "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" // \b // Plugin Data new const PLUGIN [] = "Anti-Spam" new const VERSION [] = "v2.5.2" new const AUTHOR [] = "Kane,ReymonARG," enum { NUM = 0 , POINT = 1 , DPOINT = 2 , WWW = 3 , TOTAL_LTS } public client_putinserver ( id ) check_user_name ( id ) public client_infochanged ( id ) { new oldname [ 32 ], newname [ 32 ] get_user_name ( id , oldname , 31 ) get_user_info ( id , "name" , newname , 31 ) if( ! equal ( oldname , newname ) ) check_user_name ( id , newname ) } stock check_user_name ( id , const name [ 32 ] = "" ) { new plrname [ 32 ] if( equal ( name , "" )) { get_user_name ( id , plrname , 31 ) } else { plrname = name } new g_returnvalue , g_error [ 64 ] new Regex : g_result = regex_match ( plrname , PATTERN , g_returnvalue , g_error , 63 ) switch( g_result ) { case REGEX_MATCH_FAIL , REGEX_PATTERN_FAIL : { return log_amx ( "REGEX ERROR! %s" , g_error ) } case REGEX_NO_MATCH : { return 0 } default: { new name [ 33 ] get_user_name ( id , name , 32 ) client_cmd ( id , "name ^" Intento Spammear ^ "" ) client_print ( 0 , print_chat , "[Anti-Spam] %s Fue kickeado por ponerse una ip en el nombre" , name ) server_cmd ( "kick %s" , name ) return 1 } } return - 1 } public MessageNameChange ( msgid , dest , id ) { new szInfo [ 64 ] get_msg_arg_string ( 2 , szInfo , 63 ) if(! equali ( szInfo , "#Cstrike_Name_Change" )) { return PLUGIN_CONTINUE } return PLUGIN_HANDLED } public hook_say ( id ) { new args [ 192 ], contador [ TOTAL_LTS ] read_args ( args , 191 ) replace_all ( args , 191 , " " , "" ) for( new i = 0 ; i < strlen ( args ) ; i ++) { switch( args [ i ]) { case '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' : contador [ NUM ]++ case '.' : contador [ POINT ]++ case ':' : contador [ DPOINT ]++ case 'w' : contador [ WWW ]++ } } if( contador [ NUM ] >= 5 && contador [ POINT ] || ( contador [ WWW ] >= 3 && containi ( args , ".com" ))) { client_print ( id , print_chat , "[Anti-Spam] Mensaje bloqueado. Considerado Spam" ) return PLUGIN_HANDLED } return PLUGIN_CONTINUE } // Prefix new const szPrint [] = "^4[^3Anti-Spam^4]^1 Anti-Spam detecto una^3" // MsgIds new msgSayText , g_count_spam [ 33 ] // Regex new Regex : g_rWeb , Regex : g_rIp , g_iRet // Default Values new g_iMaxSpams = 5 , g_iSpamAdd = 1 public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ) register_clcmd ( "say_team" , "hook_say" ) register_clcmd ( "say" , "hook_say" ) register_message ( get_user_msgid ( "SayText" ), "MessageNameChange" ) // Eventos register_event ( "HLTV" , "event_round_start" , "a" , "1=0" , "2=0" ) // Fakemeta register_forward ( FM_ClientUserInfoChanged , "FMClientUserInfoChanged" ) // MsgIds msgSayText = get_user_msgid ( "SayText" ) // Regex new error [ 50 ] g_rIp = regex_compile ( "(.+(\s)?\d{1,3}(\.|-|;|:|,|\s+|[A-Za-z])){1,3}" , g_iRet , error , charsmax ( error ), "i" ) if ( g_rIp < REGEX_OK ) log_amx ( "Error de Regex IP: %d | %s" , g_iRet , error ) g_rWeb = regex_compile ( "(^^http(s)://*)*[a-zA-Z0-9\-\.]+(,|\.|>|<)+[A-Za-z]{2,3}" , g_iRet , error , charsmax ( error ), "i" ) if ( g_rWeb < REGEX_OK ) log_amx ( "Error de Regex Web: %d | %s" , g_iRet , error ) } public plugin_natives () { register_native ( "as_check_string" , "native_check_string" ) register_native ( "as_add_user_count" , "native_add_user_count" ) register_native ( "as_get_spam_count" , "native_get_spam_count" ) register_native ( "as_set_spam_add" , "native_set_spam_add" ) register_native ( "as_set_max_spams" , "native_set_max_spams" ) } public plugin_end () { regex_free ( g_rIp ) regex_free ( g_rWeb ) } // as_check_string(const string[], spam[12]) public native_check_string ( iPlugin , iParams ) { new string [ 70 ], spam [ 12 ] get_string ( 1 , string , 69 ) get_string ( 2 , spam , 11 ) if (! string [ 0 ] || CheckString ( string , spam )) { set_string ( 2 , spam , 11 ) return 1 ; } return 0 ; } // as_add_user_count(id, iCount = 1) public native_add_user_count ( iPlugin , iParams ) { new id = get_param ( 1 ) if (! is_user_connected ( id )) { log_amx ( "[Anti-Spam] Invlid Id (%d)" , id ) return false ; } new iCount = get_param ( 2 ) set_count_spam ( id , iCount ) return true ; } // as_get_spam_count(id) public native_get_spam_count ( iPlugin , iParams ) { new id = get_param ( 1 ) if (! is_user_connected ( id )) { log_amx ( "[Anti-Spam] Invlid Id (%d)" , id ) return - 1 ; } return g_count_spam [ id ]; } // as_set_spam_add(num) public native_set_spam_add ( iPlugin , iParams ) { new num = get_param ( 1 ) // Sin sentido if (! num || num > g_iMaxSpams ) return false ; g_iSpamAdd = num return true ; } // as_set_max_spams(num) public native_set_max_spams ( iPlugin , iParams ) { new num = get_param ( 1 ) // Sin sentido if (! num || num < g_iSpamAdd ) return false ; g_iMaxSpams = num return true ; } public event_round_start () chatcolor ( 0 , "^4[^3Anti-Spam^4]^1 ^1Este server usa ^4%s %s ^1Creado y Editado por ^3%s" , PLUGIN , VERSION , AUTHOR ) //public client_putinserver(id) public client_connect ( id ) { new name [ 32 ], spam [ 12 ] get_user_name ( id , name , charsmax ( name )) // Regex Check if ( CheckString ( name , spam )) { server_cmd ( "kick #%d ^" Tu nombre tiene una % s en ella ^ "" , get_user_userid ( id ), spam ) return; } g_count_spam [ id ] = 0 } public FMClientUserInfoChanged ( id ) { if (! is_user_connected ( id )) return FMRES_IGNORED ; // Name vars static new_name [ 32 ], old_name [ 32 ]; get_user_name ( id , old_name , charsmax ( old_name )) get_user_info ( id , "name" , new_name , charsmax ( new_name )) // El mismo nombre.. if ( equal ( new_name , old_name )) return FMRES_IGNORED ; // Regex Check new spam [ 12 ] if ( CheckString ( new_name , spam )) { set_count_spam ( id , g_iSpamAdd ) set_user_info ( id , "name" , old_name ) chatcolor ( id , "%s %s" , szPrint , spam ) return FMRES_SUPERCEDE ; } // Set new name set_user_info ( id , "name" , new_name ) return FMRES_SUPERCEDE ; } bool : CheckString (const string [], spam [ 12 ]) { // Comparamos la string con nuestro pattern if ( regex_match_c ( string , g_rIp , g_iRet )) // || regex_match_c(string, g_rIp2, g_iRet)) { formatex ( spam , 3 , "IP" ) return true ; } // Comparamos la string con nuestro pattern de nuevo else if ( regex_match_c ( string , g_rWeb , g_iRet )) { formatex ( spam , 11 , "Pagina Web" ) return true ; } return false ; } set_count_spam ( id , iCount ) { if ( g_count_spam [ id ] + iCount >= g_iMaxSpams ) { server_cmd ( "kick #%d ^" Intentos multiples de Spam .^ "" , get_user_userid ( id )) return; } g_count_spam [ id ] += iCount chatcolor ( id , "^4[^3Anti-Spam^4]^1 ^1Te quedan ^3%d ^1/ ^3%d ^1para no ser kickeado por ^4Spammer" , g_count_spam [ id ], g_iMaxSpams ) } stock chatcolor ( id , const input [], any :...) { static szMsg [ 191 ] vformat ( szMsg , 190 , input , 3 ) message_begin ( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST , msgSayText , . player = id ) write_byte ( id ? id : 33 ) write_string ( szMsg ) message_end () }
(15/02/2021, 02:44 PM) -T-E-R-M-I- escribió: Funciona y compila bien, si te da algún error checa los include que puede que te falten.
Código PHP:
#include <amxmodx> #include <fakemeta> #include <regex> #define PATTERN "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" // \b // Plugin Data new const PLUGIN [] = "Anti-Spam" new const VERSION [] = "v2.5.2" new const AUTHOR [] = "Kane,ReymonARG," enum { NUM = 0 , POINT = 1 , DPOINT = 2 , WWW = 3 , TOTAL_LTS } public client_putinserver ( id ) check_user_name ( id ) public client_infochanged ( id ) { new oldname [ 32 ], newname [ 32 ] get_user_name ( id , oldname , 31 ) get_user_info ( id , "name" , newname , 31 ) if( ! equal ( oldname , newname ) ) check_user_name ( id , newname ) } stock check_user_name ( id , const name [ 32 ] = "" ) { new plrname [ 32 ] if( equal ( name , "" )) { get_user_name ( id , plrname , 31 ) } else { plrname = name } new g_returnvalue , g_error [ 64 ] new Regex : g_result = regex_match ( plrname , PATTERN , g_returnvalue , g_error , 63 ) switch( g_result ) { case REGEX_MATCH_FAIL , REGEX_PATTERN_FAIL : { return log_amx ( "REGEX ERROR! %s" , g_error ) } case REGEX_NO_MATCH : { return 0 } default: { new name [ 33 ] get_user_name ( id , name , 32 ) client_cmd ( id , "name ^" Intento Spammear ^ "" ) client_print ( 0 , print_chat , "[Anti-Spam] %s Fue kickeado por ponerse una ip en el nombre" , name ) server_cmd ( "kick %s" , name ) return 1 } } return - 1 } public MessageNameChange ( msgid , dest , id ) { new szInfo [ 64 ] get_msg_arg_string ( 2 , szInfo , 63 ) if(! equali ( szInfo , "#Cstrike_Name_Change" )) { return PLUGIN_CONTINUE } return PLUGIN_HANDLED } public hook_say ( id ) { new args [ 192 ], contador [ TOTAL_LTS ] read_args ( args , 191 ) replace_all ( args , 191 , " " , "" ) for( new i = 0 ; i < strlen ( args ) ; i ++) { switch( args [ i ]) { case '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' : contador [ NUM ]++ case '.' : contador [ POINT ]++ case ':' : contador [ DPOINT ]++ case 'w' : contador [ WWW ]++ } } if( contador [ NUM ] >= 5 && contador [ POINT ] || ( contador [ WWW ] >= 3 && containi ( args , ".com" ))) { client_print ( id , print_chat , "[Anti-Spam] Mensaje bloqueado. Considerado Spam" ) return PLUGIN_HANDLED } return PLUGIN_CONTINUE } // Prefix new const szPrint [] = "^4[^3Anti-Spam^4]^1 Anti-Spam detecto una^3" // MsgIds new msgSayText , g_count_spam [ 33 ] // Regex new Regex : g_rWeb , Regex : g_rIp , g_iRet // Default Values new g_iMaxSpams = 5 , g_iSpamAdd = 1 public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ) register_clcmd ( "say_team" , "hook_say" ) register_clcmd ( "say" , "hook_say" ) register_message ( get_user_msgid ( "SayText" ), "MessageNameChange" ) // Eventos register_event ( "HLTV" , "event_round_start" , "a" , "1=0" , "2=0" ) // Fakemeta register_forward ( FM_ClientUserInfoChanged , "FMClientUserInfoChanged" ) // MsgIds msgSayText = get_user_msgid ( "SayText" ) // Regex new error [ 50 ] g_rIp = regex_compile ( "(.+(\s)?\d{1,3}(\.|-|;|:|,|\s+|[A-Za-z])){1,3}" , g_iRet , error , charsmax ( error ), "i" ) if ( g_rIp < REGEX_OK ) log_amx ( "Error de Regex IP: %d | %s" , g_iRet , error ) g_rWeb = regex_compile ( "(^^http(s)://*)*[a-zA-Z0-9\-\.]+(,|\.|>|<)+[A-Za-z]{2,3}" , g_iRet , error , charsmax ( error ), "i" ) if ( g_rWeb < REGEX_OK ) log_amx ( "Error de Regex Web: %d | %s" , g_iRet , error ) } public plugin_natives () { register_native ( "as_check_string" , "native_check_string" ) register_native ( "as_add_user_count" , "native_add_user_count" ) register_native ( "as_get_spam_count" , "native_get_spam_count" ) register_native ( "as_set_spam_add" , "native_set_spam_add" ) register_native ( "as_set_max_spams" , "native_set_max_spams" ) } public plugin_end () { regex_free ( g_rIp ) regex_free ( g_rWeb ) } // as_check_string(const string[], spam[12]) public native_check_string ( iPlugin , iParams ) { new string [ 70 ], spam [ 12 ] get_string ( 1 , string , 69 ) get_string ( 2 , spam , 11 ) if (! string [ 0 ] || CheckString ( string , spam )) { set_string ( 2 , spam , 11 ) return 1 ; } return 0 ; } // as_add_user_count(id, iCount = 1) public native_add_user_count ( iPlugin , iParams ) { new id = get_param ( 1 ) if (! is_user_connected ( id )) { log_amx ( "[Anti-Spam] Invlid Id (%d)" , id ) return false ; } new iCount = get_param ( 2 ) set_count_spam ( id , iCount ) return true ; } // as_get_spam_count(id) public native_get_spam_count ( iPlugin , iParams ) { new id = get_param ( 1 ) if (! is_user_connected ( id )) { log_amx ( "[Anti-Spam] Invlid Id (%d)" , id ) return - 1 ; } return g_count_spam [ id ]; } // as_set_spam_add(num) public native_set_spam_add ( iPlugin , iParams ) { new num = get_param ( 1 ) // Sin sentido if (! num || num > g_iMaxSpams ) return false ; g_iSpamAdd = num return true ; } // as_set_max_spams(num) public native_set_max_spams ( iPlugin , iParams ) { new num = get_param ( 1 ) // Sin sentido if (! num || num < g_iSpamAdd ) return false ; g_iMaxSpams = num return true ; } public event_round_start () chatcolor ( 0 , "^4[^3Anti-Spam^4]^1 ^1Este server usa ^4%s %s ^1Creado y Editado por ^3%s" , PLUGIN , VERSION , AUTHOR ) //public client_putinserver(id) public client_connect ( id ) { new name [ 32 ], spam [ 12 ] get_user_name ( id , name , charsmax ( name )) // Regex Check if ( CheckString ( name , spam )) { server_cmd ( "kick #%d ^" Tu nombre tiene una % s en ella ^ "" , get_user_userid ( id ), spam ) return; } g_count_spam [ id ] = 0 } public FMClientUserInfoChanged ( id ) { if (! is_user_connected ( id )) return FMRES_IGNORED ; // Name vars static new_name [ 32 ], old_name [ 32 ]; get_user_name ( id , old_name , charsmax ( old_name )) get_user_info ( id , "name" , new_name , charsmax ( new_name )) // El mismo nombre.. if ( equal ( new_name , old_name )) return FMRES_IGNORED ; // Regex Check new spam [ 12 ] if ( CheckString ( new_name , spam )) { set_count_spam ( id , g_iSpamAdd ) set_user_info ( id , "name" , old_name ) chatcolor ( id , "%s %s" , szPrint , spam ) return FMRES_SUPERCEDE ; } // Set new name set_user_info ( id , "name" , new_name ) return FMRES_SUPERCEDE ; } bool : CheckString (const string [], spam [ 12 ]) { // Comparamos la string con nuestro pattern if ( regex_match_c ( string , g_rIp , g_iRet )) // || regex_match_c(string, g_rIp2, g_iRet)) { formatex ( spam , 3 , "IP" ) return true ; } // Comparamos la string con nuestro pattern de nuevo else if ( regex_match_c ( string , g_rWeb , g_iRet )) { formatex ( spam , 11 , "Pagina Web" ) return true ; } return false ; } set_count_spam ( id , iCount ) { if ( g_count_spam [ id ] + iCount >= g_iMaxSpams ) { server_cmd ( "kick #%d ^" Intentos multiples de Spam .^ "" , get_user_userid ( id )) return; } g_count_spam [ id ] += iCount chatcolor ( id , "^4[^3Anti-Spam^4]^1 ^1Te quedan ^3%d ^1/ ^3%d ^1para no ser kickeado por ^4Spammer" , g_count_spam [ id ], g_iMaxSpams ) } stock chatcolor ( id , const input [], any :...) { static szMsg [ 191 ] vformat ( szMsg , 190 , input , 3 ) message_begin ( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST , msgSayText , . player = id ) write_byte ( id ? id : 33 ) write_string ( szMsg ) message_end () }
pruébalo haber si te funciona en amx 1.9
Archivos adjuntos
anti_spam.inc (Tamaño: 1.51 KB / Descargas: 5)
Tranquilo Eso Tiene Solución ¿Para que Te Preocupas?, Y si no la Tiene ¡¡Para Que Te Preocupas!! XD
Mensajes: 449
Temas: 66
Registro en: Aug 2016
Reputación:
3
Te dejo esta opción igual
Código PHP:
#include <amxmodx> #include <amxmisc> #define IsDigit(%0) ( 48 <= %0 <= 57 ) #define MAX_TRIES 4 enum { NUM = 0 , POINT = 1 , TOTAL } new const g_szCache_KeyName [] = "name" ; new g_szPluginInfo [][] = { "Anti spam" , "1.1" , "ReymonARG" , "[ANTISPAM]" } new g_playername [ 33 ][ 32 ]; public plugin_init () { register_plugin ( g_szPluginInfo [ 0 ], g_szPluginInfo [ 1 ], g_szPluginInfo [ 2 ]); register_clcmd ( "say" , "hooksay_as" ); register_clcmd ( "say_team" , "hooksay_as" ); } public client_connect ( id ) { get_user_name ( id , g_playername [ id ], 31 ); if( StringCheck ( g_playername [ id ])) { server_cmd ( "kick #%d ^" Nombre considerado como SPAM elimina los numeros .^ "" , get_user_userid ( id )); } } public client_infochanged ( id ) { static szName [ 32 ]; get_user_info ( id , g_szCache_KeyName , szName , charsmax ( szName )); if(! equal ( szName , g_playername [ id ])) { if( StringCheck ( szName )) { server_cmd ( "kick #%d ^" Nombre considerado como SPAM elimina los numeros .^ "" , get_user_userid ( id )); } } return PLUGIN_CONTINUE ; } public hooksay_as ( id ) { new args [ 192 ], contador [ TOTAL ]; read_args ( args , 191 ); replace_all ( args , 191 , " " , "" ); for( new i = 0 ; i < strlen ( args ) ; i ++) { if( 48 <= args [ i ] <= 57 ) { contador [ NUM ]++ args [ i ] = 'x' } if( args [ i ] == 46 ) { contador [ POINT ]++ } } if( contador [ POINT ] >= 2 || containi ( args , "www" ) != - 1 ) { client_print_color ( id , print_team_default , "^4%s^1 Mensaje considerado como ^3SPAM^1." , g_szPluginInfo [ 3 ]) return PLUGIN_HANDLED ; } else if( contador [ NUM ] > MAX_TRIES ) { if( contador [ POINT ]) { client_print_color ( id , print_team_default , "^4%s^1 Mensaje considerado como ^3SPAM^1." , g_szPluginInfo [ 3 ]) return PLUGIN_HANDLED } else { client_print_color ( id , print_team_default , "^4%s^1 Mensaje considerado como ^3SPAM^1." , g_szPluginInfo [ 3 ]) return PLUGIN_HANDLED } } return PLUGIN_CONTINUE } stock StringCheck (const szString []) { static iLen , iTries ; iLen = strlen ( szString ); iTries = 0 ; for(new i ; i < iLen ; i ++) { if( IsDigit ( szString [ i ])) iTries ++; } return ( iTries > MAX_TRIES ); }
Mensajes: 39
Temas: 14
Registro en: Apr 2021
Reputación:
0
(15/02/2021, 02:44 PM) -T-E-R-M-I- escribió: Funciona y compila bien, si te da algún error checa los include que puede que te falten.
Código PHP:
#include <amxmodx> #include <fakemeta> #include <regex> #define PATTERN "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)" // \b // Plugin Data new const PLUGIN [] = "Anti-Spam" new const VERSION [] = "v2.5.2" new const AUTHOR [] = "Kane,ReymonARG," enum { NUM = 0 , POINT = 1 , DPOINT = 2 , WWW = 3 , TOTAL_LTS } public client_putinserver ( id ) check_user_name ( id ) public client_infochanged ( id ) { new oldname [ 32 ], newname [ 32 ] get_user_name ( id , oldname , 31 ) get_user_info ( id , "name" , newname , 31 ) if( ! equal ( oldname , newname ) ) check_user_name ( id , newname ) } stock check_user_name ( id , const name [ 32 ] = "" ) { new plrname [ 32 ] if( equal ( name , "" )) { get_user_name ( id , plrname , 31 ) } else { plrname = name } new g_returnvalue , g_error [ 64 ] new Regex : g_result = regex_match ( plrname , PATTERN , g_returnvalue , g_error , 63 ) switch( g_result ) { case REGEX_MATCH_FAIL , REGEX_PATTERN_FAIL : { return log_amx ( "REGEX ERROR! %s" , g_error ) } case REGEX_NO_MATCH : { return 0 } default: { new name [ 33 ] get_user_name ( id , name , 32 ) client_cmd ( id , "name ^" Intento Spammear ^ "" ) client_print ( 0 , print_chat , "[Anti-Spam] %s Fue kickeado por ponerse una ip en el nombre" , name ) server_cmd ( "kick %s" , name ) return 1 } } return - 1 } public MessageNameChange ( msgid , dest , id ) { new szInfo [ 64 ] get_msg_arg_string ( 2 , szInfo , 63 ) if(! equali ( szInfo , "#Cstrike_Name_Change" )) { return PLUGIN_CONTINUE } return PLUGIN_HANDLED } public hook_say ( id ) { new args [ 192 ], contador [ TOTAL_LTS ] read_args ( args , 191 ) replace_all ( args , 191 , " " , "" ) for( new i = 0 ; i < strlen ( args ) ; i ++) { switch( args [ i ]) { case '0' , '1' , '2' , '3' , '4' , '5' , '6' , '7' , '8' , '9' : contador [ NUM ]++ case '.' : contador [ POINT ]++ case ':' : contador [ DPOINT ]++ case 'w' : contador [ WWW ]++ } } if( contador [ NUM ] >= 5 && contador [ POINT ] || ( contador [ WWW ] >= 3 && containi ( args , ".com" ))) { client_print ( id , print_chat , "[Anti-Spam] Mensaje bloqueado. Considerado Spam" ) return PLUGIN_HANDLED } return PLUGIN_CONTINUE } // Prefix new const szPrint [] = "^4[^3Anti-Spam^4]^1 Anti-Spam detecto una^3" // MsgIds new msgSayText , g_count_spam [ 33 ] // Regex new Regex : g_rWeb , Regex : g_rIp , g_iRet // Default Values new g_iMaxSpams = 5 , g_iSpamAdd = 1 public plugin_init () { register_plugin ( PLUGIN , VERSION , AUTHOR ) register_clcmd ( "say_team" , "hook_say" ) register_clcmd ( "say" , "hook_say" ) register_message ( get_user_msgid ( "SayText" ), "MessageNameChange" ) // Eventos register_event ( "HLTV" , "event_round_start" , "a" , "1=0" , "2=0" ) // Fakemeta register_forward ( FM_ClientUserInfoChanged , "FMClientUserInfoChanged" ) // MsgIds msgSayText = get_user_msgid ( "SayText" ) // Regex new error [ 50 ] g_rIp = regex_compile ( "(.+(\s)?\d{1,3}(\.|-|;|:|,|\s+|[A-Za-z])){1,3}" , g_iRet , error , charsmax ( error ), "i" ) if ( g_rIp < REGEX_OK ) log_amx ( "Error de Regex IP: %d | %s" , g_iRet , error ) g_rWeb = regex_compile ( "(^^http(s)://*)*[a-zA-Z0-9\-\.]+(,|\.|>|<)+[A-Za-z]{2,3}" , g_iRet , error , charsmax ( error ), "i" ) if ( g_rWeb < REGEX_OK ) log_amx ( "Error de Regex Web: %d | %s" , g_iRet , error ) } public plugin_natives () { register_native ( "as_check_string" , "native_check_string" ) register_native ( "as_add_user_count" , "native_add_user_count" ) register_native ( "as_get_spam_count" , "native_get_spam_count" ) register_native ( "as_set_spam_add" , "native_set_spam_add" ) register_native ( "as_set_max_spams" , "native_set_max_spams" ) } public plugin_end () { regex_free ( g_rIp ) regex_free ( g_rWeb ) } // as_check_string(const string[], spam[12]) public native_check_string ( iPlugin , iParams ) { new string [ 70 ], spam [ 12 ] get_string ( 1 , string , 69 ) get_string ( 2 , spam , 11 ) if (! string [ 0 ] || CheckString ( string , spam )) { set_string ( 2 , spam , 11 ) return 1 ; } return 0 ; } // as_add_user_count(id, iCount = 1) public native_add_user_count ( iPlugin , iParams ) { new id = get_param ( 1 ) if (! is_user_connected ( id )) { log_amx ( "[Anti-Spam] Invlid Id (%d)" , id ) return false ; } new iCount = get_param ( 2 ) set_count_spam ( id , iCount ) return true ; } // as_get_spam_count(id) public native_get_spam_count ( iPlugin , iParams ) { new id = get_param ( 1 ) if (! is_user_connected ( id )) { log_amx ( "[Anti-Spam] Invlid Id (%d)" , id ) return - 1 ; } return g_count_spam [ id ]; } // as_set_spam_add(num) public native_set_spam_add ( iPlugin , iParams ) { new num = get_param ( 1 ) // Sin sentido if (! num || num > g_iMaxSpams ) return false ; g_iSpamAdd = num return true ; } // as_set_max_spams(num) public native_set_max_spams ( iPlugin , iParams ) { new num = get_param ( 1 ) // Sin sentido if (! num || num < g_iSpamAdd ) return false ; g_iMaxSpams = num return true ; } public event_round_start () chatcolor ( 0 , "^4[^3Anti-Spam^4]^1 ^1Este server usa ^4%s %s ^1Creado y Editado por ^3%s" , PLUGIN , VERSION , AUTHOR ) //public client_putinserver(id) public client_connect ( id ) { new name [ 32 ], spam [ 12 ] get_user_name ( id , name , charsmax ( name )) // Regex Check if ( CheckString ( name , spam )) { server_cmd ( "kick #%d ^" Tu nombre tiene una % s en ella ^ "" , get_user_userid ( id ), spam ) return; } g_count_spam [ id ] = 0 } public FMClientUserInfoChanged ( id ) { if (! is_user_connected ( id )) return FMRES_IGNORED ; // Name vars static new_name [ 32 ], old_name [ 32 ]; get_user_name ( id , old_name , charsmax ( old_name )) get_user_info ( id , "name" , new_name , charsmax ( new_name )) // El mismo nombre.. if ( equal ( new_name , old_name )) return FMRES_IGNORED ; // Regex Check new spam [ 12 ] if ( CheckString ( new_name , spam )) { set_count_spam ( id , g_iSpamAdd ) set_user_info ( id , "name" , old_name ) chatcolor ( id , "%s %s" , szPrint , spam ) return FMRES_SUPERCEDE ; } // Set new name set_user_info ( id , "name" , new_name ) return FMRES_SUPERCEDE ; } bool : CheckString (const string [], spam [ 12 ]) { // Comparamos la string con nuestro pattern if ( regex_match_c ( string , g_rIp , g_iRet )) // || regex_match_c(string, g_rIp2, g_iRet)) { formatex ( spam , 3 , "IP" ) return true ; } // Comparamos la string con nuestro pattern de nuevo else if ( regex_match_c ( string , g_rWeb , g_iRet )) { formatex ( spam , 11 , "Pagina Web" ) return true ; } return false ; } set_count_spam ( id , iCount ) { if ( g_count_spam [ id ] + iCount >= g_iMaxSpams ) { server_cmd ( "kick #%d ^" Intentos multiples de Spam .^ "" , get_user_userid ( id )) return; } g_count_spam [ id ] += iCount chatcolor ( id , "^4[^3Anti-Spam^4]^1 ^1Te quedan ^3%d ^1/ ^3%d ^1para no ser kickeado por ^4Spammer" , g_count_spam [ id ], g_iMaxSpams ) } stock chatcolor ( id , const input [], any :...) { static szMsg [ 191 ] vformat ( szMsg , 190 , input , 3 ) message_begin ( id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST , msgSayText , . player = id ) write_byte ( id ? id : 33 ) write_string ( szMsg ) message_end () }
pruébalo haber si te funciona en amx 1.9
Perdon por revivir esto, pero intente con el plugin de Kane, y no me funcionó, supuestamente me bloquea el mensaje pero de igual manera lo envia en el say, osea todo el mundo lo ve, lo unico que si hace es que si intento ponerme una IP en el tag lo bloquea, pero de resto no.
Mensajes: 215
Temas: 4
Registro en: Jan 2016
Reputación:
5
(02/05/2021, 03:21 PM) gmartinez escribió: Perdon por revivir esto, pero intente con el plugin de Kane, y no me funcionó, supuestamente me bloquea el mensaje pero de igual manera lo envia en el say, osea todo el mundo lo ve, lo unico que si hace es que si intento ponerme una IP en el tag lo bloquea, pero de resto no.
Tienes otro plugin que hookea el say
Estoy cansado de este sufrimiento llamado vivir en Venezuela
Mensajes: 39
Temas: 14
Registro en: Apr 2021
Reputación:
0
(04/05/2021, 03:57 PM) samueldmq escribió: Tienes otro plugin que hookea el say
Si Amigo Samuel gracias a una respuesta tuya lo resolvi, será que me puedes ayudar con otro PLUGIN que te envie al Privado