Plugin AntiSpam Dice que bloquea pero en realidad no bloquea
#1
Buenas alguien me puede ayudar acomodar el plugins de anti-spam, el dice que bloquea lo que uno coloca en say tanto como ip o como paginas web pero las personas pueden ver el mensaje que dice ser bloqueado por say, el otro detalle es que si me pongo una ip en nombre y entro al servidor no me kickea solo cambia el nombre ha [FOS] Intento Spammear, pero mas no los kickea, alguien me puede ayudar a acomodarlo

Código PHP:
#include <amxmodx>
#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

enum{
    
NUM 0,
    
POINT 1,
    
DPOINT 2,
    
WWW 3,
    
TOTAL_LTS


public 
plugin_init() 
{
    
register_plugin("Anti-Spam""1.0""ReymonARG")
    
register_clcmd("say_team""hook_say")
    
register_clcmd("say""hook_say"
    
register_message(get_user_msgid("SayText"), "MessageNameChange")
}

public 
client_putinserver(id)
    
check_user_name(id)

public 
client_infochanged(id)
{
    new 
oldname[32], newname[32]
    
get_user_name(idoldname31)
    
get_user_info(id"name"newname31)
    
    if( !
equal(oldnamenewname) )
        
check_user_name(idnewname)



stock check_user_name(id, const name[32] = ""
{
    new 
plrname[32]
    
    if(
equal(name""))
    {
        
get_user_name(idplrname31)
    }
    else
    {
        
plrname name
    
}
    
    new 
g_returnvalueg_error[64]
    new 
Regex:g_result regex_match(plrnamePATTERNg_returnvalueg_error63)
    switch(
g_result)
    {
        case 
REGEX_MATCH_FAILREGEX_PATTERN_FAIL:
        {
            return 
log_amx("REGEX ERROR! %s"g_error)
        }
        
        case 
REGEX_NO_MATCH:
        {
            return 
0
        
}
        
        default:
        {
            new 
name[33]
            
get_user_name(idname32)
            
client_cmd(id"name ^"[FOSIntento Spammear^"")
            
PrintText(id"!t[!g FOS!t ]!y Jugador !g%s!y fue kickeado por ponerse una !gip!y en el nombre!t."name)
            
server_cmd("kick %s"name)
        
            return 
1
        
}
    }
    
    return -
1

}

public 
MessageNameChange(msgiddestid)
{
    new 
szInfo[64

    
get_msg_arg_string(2szInfo63

    if(!
equali(szInfo"#Cstrike_Name_Change"))
    {
        return 
PLUGIN_CONTINUE    
    
}
    
    return 
PLUGIN_HANDLED
}

public 
hook_say(id)
{
    new 
args[192], contador[TOTAL_LTS]
    
    
read_args(args191)
    
    
replace_all(args191" """)
    
    for( new 
0strlen(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] >= && contador[POINT] || (contador[WWW] >= && containi(args,".com")))
    {
        
PrintText(id"!t[!g FOS!t ]!y Mensaje bloqueado!t.!y Considerado Spam")
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE
    
}
/*******************************
    STOCK CHAT COLORS CHEMA
*******************************/

stock PrintText ( const iIndex, const Text [ ], any:... ) { 
    
    new 
szText 192 ];
    
    
vformat szTextsizeof szText ), Text);
    
    
    
replace_all szTextsizeof szText ), "!y""^1" );
    
replace_all szTextsizeof szText ), "!g""^4" );
    
replace_all szTextsizeof szText ), "!t""^3" );
    
    static 
iLen sizeof szText );
    
    
    
replace_all szTextiLen"á""á" );
    
replace_all szTextiLen"Á""Ã" );
    
replace_all szTextiLen"é""é" );
    
replace_all szTextiLen"É""É" );
    
replace_all szTextiLen"í""Ã*" );
    
replace_all szTextiLen"Í""Ã" );
    
replace_all szTextiLen"ó""ó" );
    
replace_all szTextiLen"Ó""Ó" );
    
replace_all szTextiLen"ú""ú" );
    
replace_all szTextiLen"Ú""Ú" );
    
replace_all szTextiLen"ñ""ñ" );
    
replace_all szTextiLen"Ñ""Ñ" );
    
    
    
message_begin iIndex MSG_ONE_UNRELIABLE MSG_BROADCASTget_user_msgid "SayText" ), .player iIndex );
    
write_byte iIndex iIndex 33 );
    
write_string szText );
    
message_end (  );

»» RENTA TU SERVIDOR EN EVOLUTIÓN-HOST ««

Si deseas contactarme para comprar tu servidor de counter-strike puedes enviar un M.P
Responder
#2
Tenés algún plugin que hookea el say?
Steam
Responder
#3
Probá cambiando el return en el hook_say

Código PHP:
PrintText(id"!t[!g FOS!t ]!y Mensaje bloqueado!t.!y Considerado Spam")
return 
PLUGIN_HANDLED 

--->

Código PHP:
PrintText(id"!t[!g FOS!t ]!y Mensaje bloqueado!t.!y Considerado Spam")
return 
PLUGIN_HANDLED_MAIN 
Responder
#4
Proba poniendo el plugin arriba de todo en plugins.ini ja
Responder
#5
(23/08/2019, 11:24 PM)matrix123 escribió: Proba poniendo el plugin arriba de todo en plugins.ini ja

Hice lo que dijiste el problema que me presentaba era el plugins de adminprefix, ya el plugin funciona bloqueando las ip y paginas web por say, ahora por nick solo bloquea ip sin puerto ejemplo: 45.77.74.240 asi me kickea pero si me coloco de nick 45.77.74.240:27015 no me kickea como haria para que el plugin tmb me kickee usando ip con el puerto
»» RENTA TU SERVIDOR EN EVOLUTIÓN-HOST ««

Si deseas contactarme para comprar tu servidor de counter-strike puedes enviar un M.P
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)