23/08/2019, 03:59 PM
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(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 ^"[FOS] Intento 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(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")))
{
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 ( szText, sizeof ( szText ), Text, 3 );
replace_all ( szText, sizeof ( szText ), "!y", "^1" );
replace_all ( szText, sizeof ( szText ), "!g", "^4" );
replace_all ( szText, sizeof ( szText ), "!t", "^3" );
static iLen = sizeof ( szText );
replace_all ( szText, iLen, "á", "á" );
replace_all ( szText, iLen, "Á", "Ã" );
replace_all ( szText, iLen, "é", "é" );
replace_all ( szText, iLen, "É", "É" );
replace_all ( szText, iLen, "í", "Ã*" );
replace_all ( szText, iLen, "Í", "Ã" );
replace_all ( szText, iLen, "ó", "ó" );
replace_all ( szText, iLen, "Ó", "Ó" );
replace_all ( szText, iLen, "ú", "ú" );
replace_all ( szText, iLen, "Ú", "Ú" );
replace_all ( szText, iLen, "ñ", "ñ" );
replace_all ( szText, iLen, "Ñ", "Ñ" );
message_begin ( iIndex ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, get_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