Raised This Month: $ Target: $400
 0% 

A better way to check?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asd13
Member
Join Date: Apr 2009
Old 08-21-2010 , 12:49   A better way to check?
Reply With Quote #1

Is there a better way to check or is it okay? : ))

PHP Code:
#include < amxmodx >
#include < regex >

new const IP [ ] = "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)";

new 
g_Message[192];
new 
g_ReturnValue;
new 
g_Error[64];

public 
plugin_init() {
    
register_plugin"PLUGIN" "VERSION" "AUTHOR" );
    
    
register_clcmd"say" ,        "CheckSay" );
    
register_clcmd"say_team" ,    "CheckSay" );
}


public 
CheckSayid ) {
    
read_argsg_Message 191 );
    
    new 
Regex:g_CheckIp regex_matchg_Message IP g_ReturnValue g_Error 63 );
    if( 
g_ReturnValue ) {
        
client_printid print_chat "[ INFO ] Advertising is not allowed!" );
        
regex_freeg_CheckIp );
        return 
PLUGIN_HANDLED;
    }
    
    return 
PLUGIN_CONTINUE;

asd13 is offline
Reply


Thread Tools
Display Modes

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 21:52.


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