Raised This Month: $ Target: $400
 0% 

[Ayuda] Aprender hacer un antispam o como le hago


  
 
 
Thread Tools Display Modes
Author Message
MexPower
Veteran Member
Join Date: Nov 2012
Old 12-03-2012 , 21:48   [Ayuda] Aprender hacer un antispam o como le hago
#1

Bueno, hola de nuevo gente de alliedmodders, estaba pensando en un antispam que cuando hagan algun tipo de spam como si ponen algo con 27015 les salga un mensajito diciendo "Mejor Publica Mi Servidor xD" estaba pensando en algo asi
PHP Code:
register_clcmd("270""Bloquear")
}

public 
Bloquear(id)

          
client_print(idprint_chat"Mejor Publica mi servidor xD"
Bueno Yose que eso esta mal hasta mi conocimiento se hacer eso, se que si pones 270 saldra ese mensaje del client_print pero no se bloquera, y si adecuetna pones la ip completa ejemplo: 192.168.1.137:27015, no saldra el mensaje porque solo sale si pones el 270 y yo quiero adecuenta que si pones cualquier cosa que tenga el 270 salga el mensaje y se bloquie tambien
MexPower is offline
Geoslide
Senior Member
Join Date: Jun 2011
Location: Chilean player
Old 12-03-2012 , 22:06   Re: [Ayuda] Aprender hacer un antispam o como le hago
#2

alpedo

PHP Code:
/* Plugin generated by AMXX-Studio */

#include < amxmodx >

public plugin_init( ) {
    
    
register_plugin"fuckinghook""1.11""fuckingauthor" );
    
    
register_clcmd"say""hookSay" );
}

public 
hookSayid ) {
    
    static 
say192 ];
    
read_argssaycharsmaxsay ) ) 
    
    if ( 
containisay"270" ) != -) return PLUGIN_HANDLED;
    
    return 
PLUGIN_CONTINUE;

__________________
Basebuilder V6 - plugin for sale
Jailbreak V6 - plugin for sale
more plugins in progress ...

Geoslide ?

Last edited by Geoslide; 12-03-2012 at 22:07.
Geoslide is offline
fpA
Senior Member
Join Date: May 2011
Location: Zaragoza
Old 12-03-2012 , 22:17   Re: [Ayuda] Aprender hacer un antispam o como le hago
#3

192 es el maximo de escritura (en el chat de cs)?

Last edited by fpA; 12-03-2012 at 22:17.
fpA is offline
Send a message via Skype™ to fpA
BlackFur
BANNED
Join Date: Apr 2012
Location: RCL
Old 12-03-2012 , 22:20   Re: [Ayuda] Aprender hacer un antispam o como le hago
#4

PHP Code:
#include <amxmodx>

enum
{
    
NUM 0,
    
POINT 1,
    
TOTAL
}

public 
plugin_init()
{    
    
register_clcmd("say_team""hook_say")
    
register_clcmd("say""hook_say")
}

public 
hook_say(id)
{
    new 
args[192], contador[TOTAL]
    
    
read_args(args191)
    
    
replace_all(args191" """)
    
    for( new 
0strlen(args) ; i++)
    {
        if(
48 <= args[i] <= 57)//del 48 a 57 son los numeros en ascii
        
{
            
contador[NUM]++
            
args[i] = 'x'
            
        
}
        if(
args[i] == 46)//el 46 es el punto
        
{
            
contador[POINT]++
        }
    }
    
    if(
contador[NUM] >= && contador[POINT])
    {
        
client_cmd(id,"say %s",args)
        
        return 
PLUGIN_HANDLED
    
}
    
    return 
PLUGIN_CONTINUE

BlackFur is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 12-04-2012 , 08:19   Re: [Ayuda] Aprender hacer un antispam o como le hago
#5

es un poco viejo pero va bien

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <printf>

#define PLUGIN "Block Say"
#define VERSION "1.1"
#define AUTHOR "[R]ak"

enum _:Cvars {
    
MAX_DIGIT,
    
HOSTNAME
}

new Array:
BlockSayg_BlockSayg_Cvar[Cvars], g_MaxPlayersg_ServerName[64]

public 
plugin_init() {
    
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say""cmdCheck")
    
    
register_clcmd("say_team""cmdCheck")
    
    
g_Cvar[MAX_DIGIT] = register_cvar("rak_max_digit""9")
    
    
g_Cvar[HOSTNAME] = register_cvar("rak_host_name""FG-ARG.net")
    
    
register_logevent("logevent_round_start"2"1=Round_Start")
    
    
g_MaxPlayers get_maxplayers()
}

public 
logevent_round_start() {
    
    for(new 
1<= g_MaxPlayersi++) {
        
        if(
is_user_connected(i)) {
            
            
printf(iGRAY"[R]ak Acme Inc.-^x04 Anti-Spam^x01 %s"VERSION)
            
            
printf(iGRAY"Gracias por jugar en ^x04%s"g_ServerName)
        }
    }
}

public 
plugin_cfg() {
    
    
BlockSay ArrayCreate(641)
    
    new 
ConfigDir[64]
    
    
get_configsdir(ConfigDircharsmax(ConfigDir))
    
    
format(ConfigDircharsmax(ConfigDir), "%s/BlockSay.ini"ConfigDir
    
    if(!
file_exists(ConfigDir))
        
create_file(ConfigDir)
    
    new 
Data[37], File fopen(ConfigDir"rt")
    
    while (!
feof(File)) {
        
        
fgets(FileDatacharsmax(Data))
        
        
trim(Data)
        
        if (
Data[0] == ';' || !Data[0]) 
            continue;
        
        
rak_remove_quotes(Data)
        
        
ArrayPushString(BlockSay,Data)
        
        
g_BlockSay++
        
    }
    
    
fclose(File)
    
    
get_pcvar_string(g_Cvar[HOSTNAME], g_ServerNamecharsmax(g_ServerName))
    
}

create_file(ConfigDir[]) {
    
    new 
File fopen(ConfigDir"wt")
    
    
fprintf(File"; BlockSay By [R]ak Acme Inc.-^n; File location: $moddir/addons/amxmodx/configs/BlockSay.ini^n^n; Las lineas que empiezan con ; son comentarios^n^n; Ejemplo de palabra para chequear:^n; ^"puto^"^n^n; Hay que poner una palabra abajo de la otra y no es necesario usar mayusculas^n;Enjoy")
    
    
fclose(File)
}

public 
cmdCheck(id) {
    
    if(
is_user_admin(id))
        return 
PLUGIN_CONTINUE
    
    
static Args[192]
    
    
read_args(Argscharsmax(Args))
    
    
rak_remove_quotes(Args)
    
    if((
contain(Args"%") != -1) || check_ip(Args) || check_words(Args))
        return 
PLUGIN_HANDLED
    
    
return PLUGIN_CONTINUE
    
}

check_words(Say[]) {
    
    static 
word[64], i
    
    
for(0g_BlockSayi++) {
        
        
ArrayGetString(BlockSayiwordcharsmax(word))
        
        if(
containi(Sayword) != -1)
            return 
true
        
    
}
    
    return 
false
}

check_ip(Say[]) {
    
    static 
digitilen
    
    len 
rak_strlen(Say)
    
    
digit 0
    
    
for(0leni++) {
        
        if(
rak_isdigit(Say[i]))
            
digit++
        
    }
    
    if(
digit >= get_pcvar_num(g_Cvar[MAX_DIGIT]))
        return 
true
    
    
return false
    
}

stock rak_isdigit(Value)
    return (
48 <= Value <= 57)

stock rak_strlen(Args[]) {
    
    static 
n
    
    
for(0/* nothing */n++)
        if(!
Args[n])
            break
    
    return 
n
    
}

stock rak_remove_quotes(Args[]) {
    
    static 
n
    
    
if(!Args[0])
        return
    else if(
Args[0] == 34) {
        
        for(
1;/* nothing */n++) {
            
            if(!
Args[n] || Args[n] == 34 && !Args[n+1]) {
                
                
Args[n] = 0
                
                
break;
                
            }
            
            
Args[n-1] = Args[n]
            
        }
    }
    else {
        
        for(
1;/* nothing */n++) {
            
            if(!
Args[n] || Args[n] == 34 && !Args[n+1]) {
                
                
Args[n] = 0
                
                
break;
                
            }
        }    
    }

este plugin te va a crear un archivo en la carpeta configs llamado BlockSay.ini ahi podes agregar palabras las cuales si un usuario escribe algo y contiene alguna de las palabras que agregaste las bloquea.. tenes que ponerlas 1 abajo de la otra..

tambien fijate que hay una cvar register_cvar("rak_host_name", "FG-ARG.net") cambia a tu gusto el FG-ARG.net

si tenes el admin color chat tenes que poner el plugin este arriba en la lista en plugins.ini

y tambien fixea el bug del admin chat color
Attached Files
File Type: inc printf.inc (1.1 KB, 107 views)
__________________

www.amxmodx-es.com

Steam: Luchokoldo

Last edited by rak; 12-04-2012 at 08:24.
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 12-04-2012 , 09:51   Re: [Ayuda] Aprender hacer un antispam o como le hago
#6

Quote:
Originally Posted by rak View Post
es un poco viejo pero va bien

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <printf>

#define PLUGIN "Block Say"
#define VERSION "1.1"
#define AUTHOR "[R]ak"

enum _:Cvars {
    
MAX_DIGIT,
    
HOSTNAME
}

new Array:
BlockSayg_BlockSayg_Cvar[Cvars], g_MaxPlayersg_ServerName[64]

public 
plugin_init() {
    
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say""cmdCheck")
    
    
register_clcmd("say_team""cmdCheck")
    
    
g_Cvar[MAX_DIGIT] = register_cvar("rak_max_digit""9")
    
    
g_Cvar[HOSTNAME] = register_cvar("rak_host_name""FG-ARG.net")
    
    
register_logevent("logevent_round_start"2"1=Round_Start")
    
    
g_MaxPlayers get_maxplayers()
}

public 
logevent_round_start() {
    
    for(new 
1<= g_MaxPlayersi++) {
        
        if(
is_user_connected(i)) {
            
            
printf(iGRAY"[R]ak Acme Inc.-^x04 Anti-Spam^x01 %s"VERSION)
            
            
printf(iGRAY"Gracias por jugar en ^x04%s"g_ServerName)
        }
    }
}

public 
plugin_cfg() {
    
    
BlockSay ArrayCreate(641)
    
    new 
ConfigDir[64]
    
    
get_configsdir(ConfigDircharsmax(ConfigDir))
    
    
format(ConfigDircharsmax(ConfigDir), "%s/BlockSay.ini"ConfigDir
    
    if(!
file_exists(ConfigDir))
        
create_file(ConfigDir)
    
    new 
Data[37], File fopen(ConfigDir"rt")
    
    while (!
feof(File)) {
        
        
fgets(FileDatacharsmax(Data))
        
        
trim(Data)
        
        if (
Data[0] == ';' || !Data[0]) 
            continue;
        
        
rak_remove_quotes(Data)
        
        
ArrayPushString(BlockSay,Data)
        
        
g_BlockSay++
        
    }
    
    
fclose(File)
    
    
get_pcvar_string(g_Cvar[HOSTNAME], g_ServerNamecharsmax(g_ServerName))
    
}

create_file(ConfigDir[]) {
    
    new 
File fopen(ConfigDir"wt")
    
    
fprintf(File"; BlockSay By [R]ak Acme Inc.-^n; File location: $moddir/addons/amxmodx/configs/BlockSay.ini^n^n; Las lineas que empiezan con ; son comentarios^n^n; Ejemplo de palabra para chequear:^n; ^"puto^"^n^n; Hay que poner una palabra abajo de la otra y no es necesario usar mayusculas^n;Enjoy")
    
    
fclose(File)
}

public 
cmdCheck(id) {
    
    if(
is_user_admin(id))
        return 
PLUGIN_CONTINUE
    
    
static Args[192]
    
    
read_args(Argscharsmax(Args))
    
    
rak_remove_quotes(Args)
    
    if((
contain(Args"%") != -1) || check_ip(Args) || check_words(Args))
        return 
PLUGIN_HANDLED
    
    
return PLUGIN_CONTINUE
    
}

check_words(Say[]) {
    
    static 
word[64], i
    
    
for(0g_BlockSayi++) {
        
        
ArrayGetString(BlockSayiwordcharsmax(word))
        
        if(
containi(Sayword) != -1)
            return 
true
        
    
}
    
    return 
false
}

check_ip(Say[]) {
    
    static 
digitilen
    
    len 
rak_strlen(Say)
    
    
digit 0
    
    
for(0leni++) {
        
        if(
rak_isdigit(Say[i]))
            
digit++
        
    }
    
    if(
digit >= get_pcvar_num(g_Cvar[MAX_DIGIT]))
        return 
true
    
    
return false
    
}

stock rak_isdigit(Value)
    return (
48 <= Value <= 57)

stock rak_strlen(Args[]) {
    
    static 
n
    
    
for(0/* nothing */n++)
        if(!
Args[n])
            break
    
    return 
n
    
}

stock rak_remove_quotes(Args[]) {
    
    static 
n
    
    
if(!Args[0])
        return
    else if(
Args[0] == 34) {
        
        for(
1;/* nothing */n++) {
            
            if(!
Args[n] || Args[n] == 34 && !Args[n+1]) {
                
                
Args[n] = 0
                
                
break;
                
            }
            
            
Args[n-1] = Args[n]
            
        }
    }
    else {
        
        for(
1;/* nothing */n++) {
            
            if(!
Args[n] || Args[n] == 34 && !Args[n+1]) {
                
                
Args[n] = 0
                
                
break;
                
            }
        }    
    }

este plugin te va a crear un archivo en la carpeta configs llamado BlockSay.ini ahi podes agregar palabras las cuales si un usuario escribe algo y contiene alguna de las palabras que agregaste las bloquea.. tenes que ponerlas 1 abajo de la otra..

tambien fijate que hay una cvar register_cvar("rak_host_name", "FG-ARG.net") cambia a tu gusto el FG-ARG.net

si tenes el admin color chat tenes que poner el plugin este arriba en la lista en plugins.ini

y tambien fixea el bug del admin chat color
habia mas publicidad rak creo, pero el plugin me funciono perfecto, me salvo el culo en mi zp por lvl.
__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"
Roccoxx is offline
Send a message via MSN to Roccoxx
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 12-04-2012 , 10:03   Re: [Ayuda] Aprender hacer un antispam o como le hago
#7

Quote:
Originally Posted by Roccoxx View Post
habia mas publicidad rak creo, pero el plugin me funciono perfecto, me salvo el culo en mi zp por lvl.
PHP Code:
public logevent_round_start() {
    
    for(new 
1<= g_MaxPlayersi++) {
        
        if(
is_user_connected(i)) {
            
            
printf(iGRAY"[R]ak Acme Inc.-^x04 Anti-Spam^x01 %s"VERSION)
            
            
printf(iGRAY"Gracias por jugar en ^x04%s"g_ServerName)
        }
    }



yo contento y tu tambien.. el unico spam que vas a tener va a ser el mio
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
MexPower
Veteran Member
Join Date: Nov 2012
Old 12-05-2012 , 13:48   Re: [Ayuda] Aprender hacer un antispam o como le hago
#8

Jajaja quitare tu SPAM del plugin xD, hey we gracias solo una duda, como creo o donde descargo el archivo .ini para agregar las cosas que no quiero que digan w
MexPower is offline
rak
Veteran Member
Join Date: Oct 2011
Location: banned country
Old 12-05-2012 , 13:51   Re: [Ayuda] Aprender hacer un antispam o como le hago
#9

se crea automaticamente cuando pones el plugin( y cambias de mapa ); luego que se genero agregas las palabras y la proxima ves que se cambia el mapa las palabras que agregaste seran bloqueadas
__________________

www.amxmodx-es.com

Steam: Luchokoldo
rak is offline
Send a message via MSN to rak Send a message via Skype™ to rak
MexPower
Veteran Member
Join Date: Nov 2012
Old 12-05-2012 , 13:54   Re: [Ayuda] Aprender hacer un antispam o como le hago
#10

Sii buueno Gracias xP y bueno y donde creo esa madre de client_print,id Algo asi para que cuando intenten el spam les salga el mensaje de que esta prohibido nomas dime donde w
MexPower is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode