AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Solved Anti Spam Ip In Nick (https://forums.alliedmods.net/showthread.php?t=308262)

Alber9091 06-13-2018 11:02

Anti Spam Ip In Nick
 
Hello, AlliedMods.

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

instinctpt1 06-13-2018 12:41

Re: Anti Spam Ip In Nick
 
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))



fysiks 06-13-2018 21:59

Re: Anti Spam Ip In Nick
 
Use Restrict Names plugin so that you can detect an IP address with RegEx.

Alber9091 06-13-2018 22:38

Re: Anti Spam Ip In Nick
 
Quote:

Originally Posted by fysiks (Post 2596825)
Use Restrict Names plugin so that you can detect an IP address with RegEx.

https://forums.alliedmods.net/showthread.php?p=147257

tarsisd2 06-13-2018 23:38

Re: Anti Spam Ip In Nick
 
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;



Visinescu 06-14-2018 10:58

Re: Anti Spam Ip In Nick
 
I don't think steam users do this, i'm smelling a non-steam stick .

soumyadip77 06-14-2018 11:42

Re: Anti Spam Ip In Nick
 
Quote:

Originally Posted by Visinescu (Post 2596935)
I don't think steam users do this, i'm smelling a non-steam stick .

some indians do this :)

Mordekay 06-14-2018 13:41

Re: Anti Spam Ip In Nick
 
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.

CrAzY MaN 06-14-2018 13:51

Re: Anti Spam Ip In Nick
 
You can use "Restrict Names" plugin.

Alber9091 06-14-2018 17:18

Re: Anti Spam Ip In Nick
 
Quote:

Originally Posted by tarsisd2 (Post 2596849)
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 :)


All times are GMT -4. The time now is 00:48.

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