Raised This Month: $ Target: $400
 0% 

Block IP Pattern (With Spaces)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 08-05-2019 , 09:16   Re: Block IP Pattern (With Spaces)
Reply With Quote #8

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; }
__________________

Last edited by Relaxing; 08-05-2019 at 09:18.
Relaxing 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