View Single Post
Alber9091
Veteran Member
Join Date: Jun 2014
Location: Karachi, Pakistan
Old 08-06-2019 , 01:41   Re: Block IP Pattern (With Spaces)
Reply With Quote #16

Quote:
Originally Posted by bad_boy View Post
Can you please give mines a try, it should block the spaces.
I'm sure the plugin can be improved so test it and give me some feedback.
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <regex>

new const BlockIps[ ] = "\b(?:\d{1,3}\s)\d{1,3}\b"

new ret,error]
new 
Regex:Spam

public plugin_init() 
{
    
register_plugin"Block IP""1.0""Allied")

    
register_clcmd"say""spamming" )
    
register_clcmd"say_team""spamming" )

    
Spam regex_compile BlockIpsreterrorcharsmax error ) )
}

public 
spammingid 
{
    new 
text128 ], ret
    read_args
textcharsmaxtext ) )

    new 
Check regex_match_ctextSpamret )
        
    if( 
Check 
    {
        
client_printidprint_chat"Stop Advertising !!" )
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE

Will give it a try, when at home.
Till yet as said by you, may be someone improve it too?
Alber9091 is offline