Raised This Month: $ Target: $400
 0% 

block symbols


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 05-08-2021 , 19:34   Re: block symbols
Reply With Quote #1

try this, untested

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <colorchat>

#define PLUGIN "Block symbols"
#define VERSION "1.0"
#define AUTHOR ""

new const g_prefix[] = "=[PROTECT]"

new const symbols[] =
{
    
"!",
    
"#",
    
"*",
    
"(",
    
")",
    
"-",
    
"_",
    
"+",
    
"=",
    
"{",
    
"}",
    
"[",
    
"]",
    
"|",
    
"\",
    "
/",
    "
:",
    "
;",
    "
,",
    "
~",
    "
`",
    "<",
    ">",
    "ï¼…s0 114",
    "%",
    "&"
}

new const g_szExceptions[] =
{
    ".com",
    ".ro",
    "imgur"
}

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

public handle_say(id)
{
    new arg[256]
    read_args(arg,255)
    remove_quotes(arg)
    trim(arg)

    if(arg[0] =='^0' || !strlen(arg)) return PLUGIN_HANDLED

    for(new i=0;i<charsmax(symbols);i++) 
    {
        if(containi(arg,symbols[i]) != -1 && containi(arg, g_szExceptions[i]) != -1)
        {
            ColorChat(id,GREEN,"^x04%s^x03Your chat message can not contain ^4symbols^x03 or^x04 advertising words",g_prefix)
            return PLUGIN_HANDLED
        }
    }
    return PLUGIN_CONTINUE

__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
giumbalau
Member
Join Date: Jan 2021
Old 05-08-2021 , 19:57   Re: block symbols
Reply With Quote #2

Quote:
Originally Posted by Napoleon_be View Post
try this, untested

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <colorchat>

#define PLUGIN "Block symbols"
#define VERSION "1.0"
#define AUTHOR ""

new const g_prefix[] = "=[PROTECT]"

new const symbols[] =
{
    
"!",
    
"#",
    
"*",
    
"(",
    
")",
    
"-",
    
"_",
    
"+",
    
"=",
    
"{",
    
"}",
    
"[",
    
"]",
    
"|",
    
"\",
    "
/",
    "
:",
    "
;",
    "
,",
    "
~",
    "
`",
    "<",
    ">",
    "ï¼…s0 114",
    "%",
    "&"
}

new const g_szExceptions[] =
{
    ".com",
    ".ro",
    "imgur"
}

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

public handle_say(id)
{
    new arg[256]
    read_args(arg,255)
    remove_quotes(arg)
    trim(arg)

    if(arg[0] =='^0' || !strlen(arg)) return PLUGIN_HANDLED

    for(new i=0;i<charsmax(symbols);i++) 
    {
        if(containi(arg,symbols[i]) != -1 && containi(arg, g_szExceptions[i]) != -1)
        {
            ColorChat(id,GREEN,"^x04%s^x03Your chat message can not contain ^4symbols^x03 or^x04 advertising words",g_prefix)
            return PLUGIN_HANDLED
        }
    }
    return PLUGIN_CONTINUE

Thank you thank you very much
giumbalau is offline
Reply



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 20:00.


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