View Single Post
bad_boy
Member
Join Date: Oct 2018
Old 08-05-2019 , 19:26   Re: Block IP Pattern (With Spaces)
Reply With Quote #15

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


Last edited by bad_boy; 08-05-2019 at 21:02.
bad_boy is offline