Raised This Month: $ Target: $400
 0% 

Anti-Advertisement plugin questions


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
bibu
Veteran Member
Join Date: Sep 2010
Old 11-22-2010 , 15:09   Anti-Advertisement plugin questions
Reply With Quote #1

I have seen a new plugin in the new plugins section:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <regex>
new Regex:reret;

public 
plugin_init() {
    
register_plugin("Anti-Ad""0.1""Mati");
    
register_clcmd("say""CheckMessage");
    
register_clcmd("say_team""CheckMessage");
    
    new 
err[32];
    
re regex_compile("(?:\w+\.[a-z]{2,4}\b|(?:\s*\d+\s*\.){3})"reterr31"i");
    if (
re!=REGEX_OKserver_print("Error: %s (%d)"errret);
}

public 
CheckMessage(id) {
    if (
id && id 33 && !is_user_admin(id)) {
        new 
text[64];
        
read_args(text,63);
        
        if (
strlen(text) > 4) {
            new 
match regex_match_c(textreret);
        
            if (
match 0) {
                
client_print(idprint_chat"Advertising is prohibited on this server!");
                return 
PLUGIN_HANDLED;
            }
        }
    }
    return 
PLUGIN_CONTINUE;
}

public 
plugin_end() {
    
regex_free(re);    

Now I wanted to ask, how does it get the IP's and what kind of stuff does it really block, this line should say enough I think but I still don't know how it really works:

PHP Code:
re regex_compile("(?:\w+\.[a-z]{2,4}\b|(?:\s*\d+\s*\.){3})" 
bibu 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 11:23.


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