Raised This Month: $ Target: $400
 0% 

Solved Anti Spam Ip In Nick


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
tarsisd2
Veteran Member
Join Date: Feb 2016
Location: brazil
Old 06-13-2018 , 23:38   Re: Anti Spam Ip In Nick
Reply With Quote #5

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;

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


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