Raised This Month: $ Target: $400
 0% 

[Problem] Anti-Spam Lite (Edited version) BUG


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MeinHerzBrennt
Junior Member
Join Date: Oct 2014
Location: Split, Croatia
Old 05-10-2015 , 18:54   Re: [Problem] Anti-Spam Lite (Edited version) BUG
Reply With Quote #1

PHP Code:
new Regex:regex regex_match (text"\b(?:\d{1,3}(\,|\<|\>|\~|\«|\»|\=|\.|\s|\*|\')){3}\d{1,3}\b"numerror49"i"
Like this?

Last edited by MeinHerzBrennt; 05-10-2015 at 19:11.
MeinHerzBrennt is offline
Freezo Begin
BANNED
Join Date: Mar 2014
Location: Morocco
Old 05-10-2015 , 19:38   Re: [Problem] Anti-Spam Lite (Edited version) BUG
Reply With Quote #2

Code:
#include <amxmodx> #include <amxmisc> #include <regex> // Preprocessor macros (Config) #define KICK_NICK_REASON "Spam in nick!" #define IN_GAME_WARNING_MSG    "Advertising other servers or web sites is strictly prohibited!" #define KICK_MSG_REASON "Spam message!" #define MSG_BLOCK_INFO "Advertising on your behalf, please do not advertise other sites/servers" public plugin_init() {     register_plugin("Anti-Spam Lite", "1.0.4", "NullWarez")     register_clcmd("say","check_player_msg")     register_clcmd("say_team","check_player_msg") } // Check the nick when connecting public client_connect(id) {     if(is_user_admin(id))         return PLUGIN_CONTINUE     new g_name[32]     get_user_name(id, g_name,31)     if(is_invalid(g_name))     {         server_cmd("kick #%d Disallowed nickname!", get_user_userid(id))         return PLUGIN_CONTINUE     }     set_task(20.0, "showWarning", id)     return PLUGIN_CONTINUE } // Checks the message for spam bool:is_invalid(const text[]) {     new error[168], num     new Regex:regex = regex_match (text, "\b(?:\d{1,3}(\,|\<|\>|\~|||\=|\.|\s|\*|\')){3}\d{1,3}\b", num, error, charsmax(error))     if(regex >= REGEX_OK)     {         regex_free(regex)         return true     }     return false } // Displays a warning ban for spam public showWarning(id) {     if(is_user_connected(id))         client_print(id, print_chat, "Advertising other servers or web sites is strictly prohibited!") } // Check say or say_team message public check_player_msg(id) {     if(is_user_admin(id))         return PLUGIN_CONTINUE     new text[128]     read_args(text,127)     if(is_invalid(text))     {         client_print(id, print_chat, "Advertising other servers or web sites is strictly prohibited!")         return PLUGIN_HANDLED     }     return PLUGIN_CONTINUE } // Called when set name public client_infochanged(id) {     if(is_user_admin(id))         return PLUGIN_CONTINUE     if(!is_user_alive(id)) // loop fix         return PLUGIN_CONTINUE     new g_name[32]     get_user_name(id, g_name,31)     if(is_invalid(g_name))     {         server_cmd("kick #%d Disallowed nickname!", get_user_userid(id))         return PLUGIN_CONTINUE     }     return PLUGIN_CONTINUE }

Edit : Or just use this

Code:
\d+(\.|\s|\+|_|\:|,)\d(\.|\s|\+|_|\:|,)\d(\.|\s|\+|_|\:|,)\d(\.|\s|\+|_|\:|,)\d+

Last edited by Freezo Begin; 05-11-2015 at 06:44.
Freezo Begin is offline
Reply



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


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