Raised This Month: $ Target: $400
 0% 

no Advertising


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
amerx11x
Member
Join Date: Feb 2009
Old 06-22-2009 , 13:56   no Advertising
Reply With Quote #1

hi
i need plugin for stop Advertising like when some one type ip adrees to say :This Server Is the ROck


Not ban
amerx11x is offline
MajeStik
Member
Join Date: Jun 2009
Old 06-22-2009 , 14:05   Re: no Advertising
Reply With Quote #2

PHP Code:
#define PLUGINNAME    "Don't say IP's"
#define VERSION        "0.1"
#define AUTHOR        "Cyber-Zone"
/*
Copyleft 2005
Plugin topic: http://www.amxmodx.org/forums/viewtopic.php?p=90172


Don't say IPs
=============
Messages like "hey join my server 213.34.231.23" are automatically blocked... and another message is printed instead. :-P
Or, you can choose to just ban violators by setting cvar ip_banviolators to 1 and ip_banminutes to how many minutes the violator should be banned. 0 is permanent, 5 is default.

/JGHG


VERSIONS
========
050204    0.1    First version


CREDITS
=======
Requested by lord_inuyasha88.
*/

#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
#define REASON                "IP advertising"
#define CVAR_BANMINUTES        "ip_banminutes"
#define CVAR_BANVIOLATORS    "ip_banviolators"

// Globals below
new Regex:g_result
new g_returnvalue
new g_error[64]
new 
g_allArgs[1024]
// Globals above

public plugin_modules() {
    
require_module("regex")
}

public 
hook_say(idlevelcid) {
    
read_args(g_allArgs1023)
    
g_result regex_match(g_allArgsPATTERNg_returnvalueg_error63)
    switch (
g_result) {
        case 
REGEX_MATCH_FAIL: {
            
log_amx("REGEX_MATCH_FAIL! %s"g_error)
            return 
PLUGIN_CONTINUE
        
}
        case 
REGEX_PATTERN_FAIL: {
            
log_amx("REGEX_PATTERN_FAIL! %s"g_error)
            return 
PLUGIN_CONTINUE
        
}
        case 
REGEX_NO_MATCH: {
            return 
PLUGIN_CONTINUE
        
}
        default: {
            if (
get_cvar_num(CVAR_BANVIOLATORS)) {
                new 
userid get_user_userid(id)
                new 
minutesString[10]
                
get_cvar_string(CVAR_BANMINUTESminutesString9)
                new 
temp[64], banned[16], minutes get_cvar_num(CVAR_BANMINUTES)
    
                if (
minutes)
                    
format(temp63"%L"id"FOR_MIN"minutesString)
                else
                    
format(temp63"%L"id"PERM")
                
                
format(banned15"%L"id"BANNED")
    
                new 
authid[32]
                
get_user_authid(idauthid31)
    
                new 
name[32]
                
get_user_name(idname31)
                
log_amx("%s (%s), %s %s Reclama la alt Server. ^"%s^""nameauthidbannedtempg_allArgs)
    
                
server_cmd("kick #%d ^"%(%%s)^";wait;banid ^"%d^" ^"%s^";wait;writeid"useridREASONbannedtempminutesauthid)                
            }
            else {
                
client_cmd(id"say ^"This server is the rock^"")
            }
            
regex_free(g_result)
            return 
PLUGIN_HANDLED // block msg
        
}
    }
    
    return 
PLUGIN_CONTINUE
}



public 
plugin_init() {
    
register_plugin(PLUGINNAMEVERSIONAUTHOR)
    
    
register_clcmd("say""hook_say")
    
register_cvar(CVAR_BANVIOLATORS"0")
    
register_cvar(CVAR_BANMINUTES"30")
    
    
register_dictionary("admincmd.txt")

MajeStik is offline
amerx11x
Member
Join Date: Feb 2009
Old 06-22-2009 , 14:18   Re: no Advertising
Reply With Quote #3

ok if some one change his name to ip adrees how i can stop it ?
amerx11x is offline
MajeStik
Member
Join Date: Jun 2009
Old 06-22-2009 , 14:23   Re: no Advertising
Reply With Quote #4

Ban always...I don't think someone change his nickname to an ip adress to advertising..
MajeStik is offline
Owyn
Veteran Member
Join Date: Nov 2007
Old 06-22-2009 , 16:12   Re: no Advertising
Reply With Quote #5

but they do, look in approved plugins, there are already many plugins to do what you want
__________________
☜ Free Mozy ☂backup\҉sync user
Quote:
Американский форум - Задаёшь вопрос, потом тебе отвечают.
Израильский форум - Задаёшь вопрос, потом тебе задают вопрос.
Русский форум - Задаёшь вопрос, потом тебе долго рассказывают, какой ты мудак.
Owyn is offline
Send a message via ICQ to Owyn
Emilioneri
Senior Member
Join Date: Feb 2009
Location: Georgia, Tbilisi
Old 06-23-2009 , 09:52   Re: no Advertising
Reply With Quote #6

Use "restrict name" or "name replacement" plugin
__________________
Emilioneri is offline
Send a message via Skype™ to Emilioneri
Reply



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 15:32.


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