Quote:
Originally Posted by Relaxing
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?