Raised This Month: $130 Target: $400
 32% 

Solved Anti Spam Ip In Nick


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alber9091
Senior Member
Join Date: Jun 2014
Location: Some Where On Earth
Old 06-13-2018 , 11:02   Anti Spam Ip In Nick
Reply With Quote #1

Hello, AlliedMods.

I need a simple plugin which disallow any ip in nick (name), except those in code or Nickwhitlelist.cfg (Ip)

Last edited by Alber9091; 06-14-2018 at 17:40.
Alber9091 is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Rajasthan, India
Old 06-13-2018 , 12:41   Re: Anti Spam Ip In Nick
Reply With Quote #2

There can be intense logic of detecting a IP
But still posting this little thing.. maybe if this can help

PHP Code:
#include <amxmodx>

new Blocked[][] =
{
    
":27015"":27016""1.2.3.4" // xD
}

public 
plugin_init()
    
register_plugin("Anti Name IP""1.0""DiGiTaL")

public 
client_authorized(id)
{
    new 
szName[32]
    
get_user_name(idszNamecharsmax(szName))
    for(new 
isizeof Blocked;i++)
        if(
containi(szNameBlocked[i]) != -1
            
server_cmd("kick #%d ^"IP Spam is not allowed Here !^""get_user_userid(id))

__________________
CSIndia The only Indian Scripters Community
instinctpt1 is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 06-13-2018 , 21:59   Re: Anti Spam Ip In Nick
Reply With Quote #3

Use Restrict Names plugin so that you can detect an IP address with RegEx.
__________________
fysiks is offline
Alber9091
Senior Member
Join Date: Jun 2014
Location: Some Where On Earth
Old 06-13-2018 , 22:38   Re: Anti Spam Ip In Nick
Reply With Quote #4

Quote:
Originally Posted by fysiks View Post
Use Restrict Names plugin so that you can detect an IP address with RegEx.
https://forums.alliedmods.net/showthread.php?p=147257
Alber9091 is offline
tarsisd2
Senior 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
Visinescu
Senior Member
Join Date: Dec 2015
Location: Tokyo
Old 06-14-2018 , 10:58   Re: Anti Spam Ip In Nick
Reply With Quote #6

I don't think steam users do this, i'm smelling a non-steam stick .
Visinescu is offline
soumyadip77
Senior Member
Join Date: Jul 2017
Location: INDIA,KOLKATA
Old 06-14-2018 , 11:42   Re: Anti Spam Ip In Nick
Reply With Quote #7

Quote:
Originally Posted by Visinescu View Post
I don't think steam users do this, i'm smelling a non-steam stick .
some indians do this
soumyadip77 is offline
Send a message via Skype™ to soumyadip77
Mordekay
Squirrel of Fortune
Join Date: Apr 2006
Location: Germany
Old 06-14-2018 , 13:41   Re: Anti Spam Ip In Nick
Reply With Quote #8

Not really. In old times as cs1.6 was more attractive i had problems with those IP spammers on my servers too. There are several plugins out there already doing what you want, just search for them.
__________________

Mordekay is offline
CrAzY MaN
Senior Member
Join Date: Mar 2017
Location: Nadiad/Gujarat/India
Old 06-14-2018 , 13:51   Re: Anti Spam Ip In Nick
Reply With Quote #9

You can use "Restrict Names" plugin.
__________________
My Plugins:

Whatsapp Group Join Request v3.0
XP + Level + Rank System v2.2

Confusing Fun Mod - 95% Completed
CrAzY MaN is online now
Alber9091
Senior Member
Join Date: Jun 2014
Location: Some Where On Earth
Old 06-14-2018 , 17:18   Re: Anti Spam Ip In Nick
Reply With Quote #10

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
Reply


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 09:05.


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