Raised This Month: $ Target: $400
 0% 

Block IP Pattern (With Spaces)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 08-05-2019 , 12:41   Re: Block IP Pattern (With Spaces)
Reply With Quote #12

Quote:
Originally Posted by Relaxing View Post
Code:
#include <amxmodx> #include <regex> #define PATTERN "(\d.*){8}" new whitelist[][] = {     "123.456.789.101:27099",     "123.456.789.101",     "yeah" } 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], bool: whitestlist;     read_args(arg, charsmax(arg));         remove_quotes(arg);     trim(arg);         for (new i = 0; i < sizeof(whitelist); i++){         if (contain(arg, whitelist[i])){             whitestlist = true;             break;         }     }         if (strlen(arg) > 7 && !whitestlist){         new match = regex_match_c(arg, re, ret);         if (match > 0){             client_print(id, print_chat, "More digits are not allowed in a single message to avoid IP spam.")             return PLUGIN_HANDLED;         }     }     return PLUGIN_CONTINUE; }
I was either looking for or planning to do something like that but if you already send then you better do
Testing the system
Quote:
identifies USER with an IP address
of over X digits so that will simply give KICK
And preferably without a checklist for the following reasons:
Because you have to write something there every time to block it is better to do a test for a user who enters the server \ who changes there and writes in chat.

I would love you to


EDIT:
Quote:
For other players who want to use this code: Block 7 numbers is pretty bad, because for example there are SERVERS who use a particular EVENT that has a name to type X numbers in chat for winning and that will block them

Last edited by Fuck For Fun; 08-05-2019 at 12:43.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
 



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 09:42.


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