Raised This Month: $ Target: $400
 0% 

Block say "123" in chat..


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
XoSeR
Junior Member
Join Date: Aug 2011
Old 07-12-2012 , 17:48   Block say "123" in chat..
Reply With Quote #1

Hey all,
I blocked if it is prescribed 123 Chat blocker and it works ..
But how do I do that If we write something before, for example: "a123" It will block .. !
Thank assistants ..
XoSeR is offline
Santaaa
BANNED
Join Date: May 2012
Old 07-13-2012 , 05:20   Re: Block say "123" in chat..
Reply With Quote #2

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>

#define PLUGIN "Block chat"
#define VERSION "1.0"
#define AUTHOR "Santa"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say""Cmdsay")
}

public 
Cmdsay(id)
{
    new 
message[256]
    
read_args(messagecharsmax(message))
    
remove_quotes(message)
    
    if (
equal(message"a123"))
    {
        new 
name[32]
        
get_user_name(idname31)
        
        
client_print(idprint_chat"%s has said the forbidden word!"name)
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE

Santaaa is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 07-13-2012 , 05:48   Re: Block say "123" in chat..
Reply With Quote #3

This is easer
PHP Code:
#include <amxmodx>

public plugin_init() {
    
register_clcmd("say a123""cmdBlock")
}

public 
cmdBlock(id)
{
    
client_print(idprint_chat"You are not allowed to type something like this")
    return 
PLUGIN_HANDLED

__________________
Artifact is offline
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 07-13-2012 , 06:45   Re: Block say "123" in chat..
Reply With Quote #4

or...

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Block chat""1.0""Santa")
    
    
register_clcmd("say""Cmdsay")
    
register_clcmd("say_team""Cmdsay")
}

public 
Cmdsay(id)
{
    new 
message[256]
    
read_args(messagecharsmax(message))
    
remove_quotes(message)
    
    if (
containi(message"123") != -1)
    {
        
client_print(idprint_chat"You are not allowed to type something like this")
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE


Last edited by guipatinador; 07-15-2012 at 13:52.
guipatinador is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 07-13-2012 , 06:57   Re: Block say "123" in chat..
Reply With Quote #5

Quote:
Originally Posted by guipatinador View Post
or...

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Block chat""1.0""Santa")
    
    
register_clcmd("say""Cmdsay")
    
register_clcmd("say_teeam""Cmdsay")
}

public 
Cmdsay(id)
{
    new 
message[256]
    
read_args(messagecharsmax(message))
    
remove_quotes(message)
    
    if (
containi(message"123") != -1)
    {
        
client_print(idprint_chat"You are not allowed to type something like this")
        return 
PLUGIN_HANDLED
    
}

You must handle plugin at end...
__________________
Artifact is offline
guipatinador
SourceMod Donner Party
Join Date: Oct 2009
Location: Poortugal
Old 07-13-2012 , 07:16   Re: Block say "123" in chat..
Reply With Quote #6

Quote:
Originally Posted by Artifact View Post
You must handle plugin at end...
Fixed.
guipatinador is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 07-13-2012 , 09:59   Re: Block say "123" in chat..
Reply With Quote #7

Quote:
Originally Posted by guipatinador View Post
or...

PHP Code:
#include <amxmodx>

public plugin_init()
{
    
register_plugin("Block chat""1.0""Santa")
    
    
register_clcmd("say""Cmdsay")
    
register_clcmd("say_teeam""Cmdsay")
}

public 
Cmdsay(id)
{
    new 
message[256]
    
read_args(messagecharsmax(message))
    
remove_quotes(message)
    
    if (
containi(message"123") != -1)
    {
        
client_print(idprint_chat"You are not allowed to type something like this")
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_CONTINUE

This is the most simple way to block a message like that imo.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
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 05:55.


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