AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Block Special Symbols In Names. (https://forums.alliedmods.net/showthread.php?t=251062)

Akshat 11-05-2014 06:45

Block Special Symbols In Names.
 
I got this plugin to block some special symbols in chat but i want it to be blocked in Player Names too,
Thanks in advance
PHP Code:

#include <amxmodx>
#include <colorchat>

new const gBlockTexts[][] = {
    
"",
    
"",
    
"",
    
"",
    
"#",
    
"%"
};

public 
plugin_init() 
{
    
register_plugin("Block Special Symbols""1.0""[~]~[N]o.Ob [K]iLl3r~[~]");
    
    
register_clcmd("say""CmdSay");
    
register_clcmd("say_team""CmdSay");
}

public 
CmdSay(id
{
    new 
args[192];
    
read_args(argscharsmax(args));
    
remove_quotes(args);
    
    for(new 
0sizeof(gBlockTexts); i++) {
        if(
containi(argsgBlockTexts[i]) != -) {
        
ColorChat(idprint_chat"Using ^3Special Symbols ^1is not ^4allowed")
            
        }
        
    }
    
    return 
PLUGIN_CONTINUE;



Fuck For Fun 11-05-2014 09:32

Re: Block Special Symbols In Names.
 
try:
Code:

#include <amxmodx>
#include <colorchat>

new const gBlockTexts[][] = {
    "",
    "",
    "",
    "",
    "#",
    "%"
};

public plugin_init()
{
    register_plugin("Block Special Symbols", "1.0", "[~]~[N]o.Ob [K]iLl3r~[~]");
   
    register_clcmd("say", "CmdSay");
    register_clcmd("say_team", "CmdSay");
}

public CmdSay(id)
{
    new args[192];
    read_args(args, charsmax(args));
    remove_quotes(args);
   
    for(new i = 0; i < sizeof(gBlockTexts); i++) {
        if(containi(args, gBlockTexts[i]) != -1 ) {
        ColorChat(id, NORMAL, "Using ^3Special Symbols ^1is not ^4allowed")
        return PLUGIN_HANDLED;
        }
    }
    return PLUGIN_CONTINUE;
}



All times are GMT -4. The time now is 17:45.

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