Raised This Month: $ Target: $400
 0% 

Block IP Pattern (With Spaces)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 08-05-2019 , 11:42   Re: Block IP Pattern (With Spaces)
Reply With Quote #9

Quote:
Originally Posted by Relaxing View Post
A quick search: https://forums.alliedmods.net/showpo...17&postcount=3
Code:
#include <amxmodx> #include <regex> #define PATTERN "(\d.*){8}" new Regex:re, ret; public plugin_init(){     register_clcmd("say", "clcmd_say");     register_clcmd("say_team", "clcmd_say");         new err[32];     re = regex_compile(PATTERN, ret, err, 31, "i");     if (re!=REGEX_OK) log_amx("Error: %s (%d)", err, ret); } public plugin_end() {     regex_free(re);     } public clcmd_say(id){     new arg[64];     read_args(arg, charsmax(arg));         remove_quotes(arg);     trim(arg);         if (strlen(arg) > 7){         new match = regex_match_c(arg, re, ret);         if (match > 0){             return PLUGIN_HANDLED;         }     }     return PLUGIN_CONTINUE; }
I will use it, till yet any other ideas are shared, between can you add message, If IP Pattern found, say: 8 or More digits are not allowed in a single message to avoid IP spam.
+ Can you add Whitelist, so I can whitelist my servers own IPs?

Last edited by Alber9091; 08-05-2019 at 12:02.
Alber9091 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