Raised This Month: $ Target: $400
 0% 

Solved Anti Spam Ip In Nick


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 06-14-2018 , 17:18   Re: Anti Spam Ip In Nick
Reply With Quote #6

Quote:
Originally Posted by tarsisd2 View Post
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <regex>

#pragma semicolon 1

#define PLUGIN "No-IP"
#define VERSION "0.1"
#define AUTHOR "Sn!ff3r"

// THX for Johnny got his gun
#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

public plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
register_clcmd("say""client_say"); 
    
register_clcmd("say_team""client_say"); 
}

public 
client_connect(id)     
{
    new 
name[33];
    
get_user_name(idnamecharsmax(name));
    
    
client_check(idname);
}

public 
client_infochanged(id
{
    new 
name[33];
    
get_user_info(id"name"namecharsmax(name));
    
    
client_check(idname);    
}

public 
client_say(id
{
    new 
message[128];
    
read_args(messagecharsmax(message));
    
    
client_check(idmessage);
}

public 
client_check(idstring[]) 
{    
    new 
Regex:resultvalueerror[2];
    
result regex_match(stringPATTERNvalueerror1);
    
    switch(
result)
    {
        case 
REGEX_MATCH_FAILREGEX_PATTERN_FAILREGEX_NO_MATCH
            return 
PLUGIN_CONTINUE;        
    }
    
    
server_cmd("kick #%d IP Spam"get_user_userid(id));
    
server_exec();    
    
    return 
PLUGIN_HANDLED;

Thanks Alot. Exactly What I Needed. ;)

And Thanks to everyone else to over their recommendations

Last edited by Alber9091; 06-14-2018 at 17:19.
Alber9091 is offline
 


Thread Tools
Display Modes

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 00:48.


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