Raised This Month: $ Target: $400
 0% 

[REQ] block chat plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cucu
Junior Member
Join Date: Apr 2011
Old 02-21-2015 , 12:29   [REQ] block chat plugin
Reply With Quote #1

Hi!
I have a cs war server, and i need help for a plugin for block SAY channel for players.
If i am admin, i can enable and disable chat for player with command !chat.
The command block only players chat, admins can say in chat permanently.
p.s Sry for my bad english.
cucu is offline
Eagle07
Veteran Member
Join Date: May 2014
Location: Morocco :D
Old 02-21-2015 , 12:56   Re: [REQ] block chat plugin
Reply With Quote #2

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

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "EaGle"

new bool:chatblocked

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say","cmd_block")
    
register_clcmd("say_team","cmd_block")
    
register_clcmd("say !chat","cmd_blockchat")
}
public 
cmd_block(id)
{
    if(
chatblocked && !(get_user_flags(id) & ADMIN_KICK))
        return 
PLUGIN_HANDLED_MAIN
        
    
return PLUGIN_CONTINUE
}
public 
cmd_blockchat(id)
{
    if(
get_user_flags(id) & ADMIN_KICK)
    {
        if(!
chatblocked)
        {
            
chatblocked true
        
}
        else
        {
            
chatblocked false
        
}
        
    }        

__________________
Eagle07 is offline
cucu
Junior Member
Join Date: Apr 2011
Old 02-21-2015 , 14:51   Re: [REQ] block chat plugin
Reply With Quote #3

Hi!
Plugin running, but i have 2 problems:
I want to be able to write on say_team for players.
And you can add a message for each function?
Say !chat - Admin x activated the chat for players.
Say !chat again - Admin x deactivated the chat for players.
If a player say in chat when it is blocked : You don't have access to use chat.
Thanks for quick response and help

Last edited by cucu; 02-21-2015 at 14:57.
cucu is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 02-21-2015 , 15:04   Re: [REQ] block chat plugin
Reply With Quote #4

Be sure to put that above the original chat plugin in plugins.ini
PHP Code:
#include <amxmodx>
#include <amxmisc>

new bool:g_bAllowed

public plugin_init() 
{
    
register_plugin("Chat Blocker""1.0""Ur Mum")
    
register_clcmd("say""onSayCmd")
    
register_clcmd("say_team""onSayCmd")
}

public 
onSayCmd(id)
{
    new 
isAdmin is_user_admin(id)
    
    if(
isAdmin)
    {
        new 
szArgs[32]
        
read_args(szArgscharsmax(szArgs))
        
remove_quotes(szArgs)
        
        if(
equali(szArgs"!chat"))
        {
            
g_bAllowed = !g_bAllowed
            client_print
(idprint_chat"[CHAT] You've turned the chat %d!"g_bAllowed "on" "off")
        }
        return 
PLUGIN_CONTINUE
    
}
    return 
g_bAllowed PLUGIN_CONTINUE PLUGIN_HANDLED

__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
cucu
Junior Member
Join Date: Apr 2011
Old 02-21-2015 , 15:31   Re: [REQ] block chat plugin
Reply With Quote #5

Thanks for help, but is not completely ..
I said in last post:

"I want to be able to write on say_team for players.
And you can add a message for each function?
Say !chat - Admin x activated the chat for players.
Say !chat again - Admin x deactivated the chat for players.
If a player say in chat when it is blocked : You don't have access to use chat.
Thanks for quick response and help"

Last edited by cucu; 02-21-2015 at 15:40.
cucu is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 02-21-2015 , 17:08   Re: [REQ] block chat plugin
Reply With Quote #6

So that's the code mostly. Here is it with the redactions.
Code:
#include <amxmodx>
#include <amxmisc>

new bool:g_bAllowed

public plugin_init() 
{
	register_plugin("Chat Blocker", "1.0", "Ur Mum")
	register_clcmd("say", "onSayCmd")
}

public onSayCmd(id)
{
	new isAdmin = is_user_admin(id)
	
	if(isAdmin)
	{
		new szArgs[32]
		read_args(szArgs, charsmax(szArgs))
		remove_quotes(szArgs)
		
		if(equali(szArgs, "!chat"))
		{
			g_bAllowed = !g_bAllowed
			client_print(id, print_chat, "[CHAT] You've turned the chat %d!", g_bAllowed ? "on" : "off")
		}
		return PLUGIN_CONTINUE
	}
	
	if(g_bAllowed)
	{
		client_print(id, print_chat, "[CHAT] You don't have access to use chat.")
		return PLUGIN_HANDLED
	}
	return PLUGIN_CONTINUE
}
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
cucu
Junior Member
Join Date: Apr 2011
Old 02-21-2015 , 18:12   Re: [REQ] block chat plugin
Reply With Quote #7

i have a little problem..

[CHAT] You've turned the chat 111!
cucu : !chat


If i write chat, appear 111 ever. :-?
cucu is offline
monster321
Member
Join Date: Apr 2012
Old 02-21-2015 , 18:21   Re: [REQ] block chat plugin
Reply With Quote #8

Is normal xddd...

Code:
client_print(id, print_chat, "[CHAT] You've turned the chat %d!", g_bAllowed ? "on" : "off")

to...

Code:
client_print(id, print_chat, "[CHAT] You've turned the chat %s!", g_bAllowed ? "ON" : "OFF")
monster321 is offline
Send a message via MSN to monster321 Send a message via Skype™ to monster321
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 02-22-2015 , 05:25   Re: [REQ] block chat plugin
Reply With Quote #9

Owww.... Tha shitty mistake, sorry. Haven't noticed it.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
cucu
Junior Member
Join Date: Apr 2011
Old 02-22-2015 , 05:57   Re: [REQ] block chat plugin
Reply With Quote #10

Thanks.. plugin running perfectly
cucu 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 08:30.


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