Raised This Month: $51 Target: $400
 12% 

Block Chat - Easy Way To Turn Off The Chat.


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Admin Commands       
Enkore
Junior Member
Join Date: Dec 2011
Old 04-29-2012 , 10:00   Block Chat - Easy Way To Turn Off The Chat.
Reply With Quote #1

Firstable , The Default Admin Flag is ADMIN_CVAR.
You Can Change it Easily at #define FLAGS.
if the cvar is 0, the mod won't work, else, it will by send to chat the command
/chat
First Time : Blocking The Chat To Players Without The Flags Level [ADMIN_CVAR]
Second Time : Enables The Chat To All.
Well, The Code is the most important isn't it ?
Big Credit To : ImNativus For Fix Some Bugs.
PHP Code:
#include <amxmodx>
#include <colorchat>

#define FLAGS ADMIN_CVAR

new bool:BlockChat;
new 
eCvar;

public 
plugin_init()
{
    
register_plugin("Block Chat""V2.0""Enkore & ImNativus"
    
register_clcmd("say""HandleSay");
    
register_clcmd("say_team""HandleSay");
    
eCvar register_cvar("chatblock_command""1")
    
register_clcmd("say /chat""CmdBlockChat");
}

public 
CmdBlockChatclientid )
{
    if ( !(
get_user_flagsclient ) & FLAGS ) && !get_pcvar_numeCvar ) )
    {
        
ColorChat(idBLUE"You Are Not An Administrator With ^1%s ^3Levels \ Cvar Is Off."FLAGS)
        return 
PLUGIN_HANDLED;
    }
    
BlockChat = !BlockChat
    new 
szName[33];
    
get_user_name(idszNamesizeof szName 1)
    
ColorChatclientBLUE"The Administrator ^4[ %s ]^3 Has ^4%s ^3The ^4Chat"szNameBlockChat "Close" "Open" );
    return 
PLUGIN_HANDLED;
}



public 
HandleSayclient ) {
    if(
get_user_flags(client) & FLAGS ) {
        return 
PLUGIN_CONTINUE;
    }
    return 
BlockChat 
    
PLUGIN_HANDLED 
    
PLUGIN_CONTINUE;  

Attached Files
File Type: sma Get Plugin or Get Source (BlockChat.sma - 733 views - 1.3 KB)

Last edited by Enkore; 04-29-2012 at 10:06.
Enkore is offline
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 04-29-2012 , 10:02   Re: Block Chat - Easy Way To Turn Off The Chat.
Reply With Quote #2

attach the .sma file. Some people might not understand how to compile by themselves.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Enkore
Junior Member
Join Date: Dec 2011
Old 04-29-2012 , 10:03   Re: Block Chat - Easy Way To Turn Off The Chat.
Reply With Quote #3

Quote:
Originally Posted by Napoleon_be View Post
attach the .sma file. Some people might not understand how to compile by themselves.
Roger That.
Enkore is offline
FODDER
Member
Join Date: Mar 2012
Location: Florida, United States
Old 04-29-2012 , 15:14   Re: Block Chat - Easy Way To Turn Off The Chat.
Reply With Quote #4

you can just do hud_saytext 0 ...
FODDER is offline
Enkore
Junior Member
Join Date: Dec 2011
Old 04-29-2012 , 15:43   Re: Block Chat - Easy Way To Turn Off The Chat.
Reply With Quote #5

Quote:
Originally Posted by FODDER View Post
you can just do hud_saytext 0 ...
i didn't know that.
but this mod is more specificst to show the users that the chat is colsed for an announcment.
btw, the command is blocking the chat also for admins i guess.
Enkore is offline
Pop0N
Member
Join Date: Apr 2011
Old 04-29-2012 , 16:42   Re: Block Chat - Easy Way To Turn Off The Chat.
Reply With Quote #6

Uhm.. taked from FXP.
no thanks, you steal that.
Pop0N is offline
simple_user
Member
Join Date: Apr 2012
Location: Latvia, the cube
Old 04-30-2012 , 08:03   Re: Block Chat - Easy Way To Turn Off The Chat.
Reply With Quote #7

Firstable => first
simple_user is offline
Send a message via Skype™ to simple_user
Enkore
Junior Member
Join Date: Dec 2011
Old 04-30-2012 , 13:12   Re: Block Chat - Easy Way To Turn Off The Chat.
Reply With Quote #8

Quote:
Originally Posted by Pop0N View Post
Uhm.. taked from FXP.
no thanks, you steal that.
Are You Sure ? Cuz i'am xLoLeD.
Enkore is offline
NucL3ra
Veteran Member
Join Date: Sep 2008
Location: Bucuresti , Romania
Old 05-01-2012 , 16:12   Re: Block Chat - Easy Way To Turn Off The Chat.
Reply With Quote #9

Quote:
Originally Posted by FODDER View Post
you can just do hud_saytext 0 ...
Actually just hud_saytext (it toggles on and off regard of the arguments you type after)
__________________
My nickname is nucLeaR, I just screwed up at registering and didn't want to change after that X_X.
NucL3ra is offline
Send a message via Yahoo to NucL3ra
Old 05-01-2012, 17:54
simple_user
This message has been deleted by simple_user.
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-01-2012 , 17:58   Re: Block Chat - Easy Way To Turn Off The Chat.
Reply With Quote #10

This plugin turns off chat for all players, not just for yourself, so hud_saytext command is not comparable to this.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] 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