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

blocking amx_tsay & amx_csay


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DPT
Member
Join Date: Jun 2011
Old 02-08-2012 , 23:00   blocking amx_tsay & amx_csay
Reply With Quote #1

Good Morning..

I am writing a plugin and i'm stuck in this issue: How can i block admins from using amx_tsay and amx_csay? Some would suggest that I should remove the admin chat flag, but in my case, I only need to block them temporarily..


Any help would be appreciated..
DPT is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 02-09-2012 , 00:58   Re: blocking amx_tsay & amx_csay
Reply With Quote #2

hook the console command , and return HANDLED.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-09-2012 , 01:31   Re: blocking amx_tsay & amx_csay
Reply With Quote #3

Quote:
Originally Posted by lucas_7_94 View Post
hook the console command , and return HANDLED.
which requires that the plugin that does this be before adminchat.amxx. I would just add it to adminchat.sma if it were me. Then you can make it more efficiently do what you want.
__________________
fysiks is online now
DPT
Member
Join Date: Jun 2011
Old 02-09-2012 , 06:44   Re: blocking amx_tsay & amx_csay
Reply With Quote #4

lucas, I've tried this code but its not blocking amx_tsay... and yes, I inserted this plugin before adminchat.amxx in plugins.ini

Code:
 
public plugin_init(){
register_plugin("Testing Something","1.0","Tester")
register_event("HLTV", "event_new_round", "a", "1=0", "2=0")  
register_event( "CurWeapon" , "knife" , "be" , "1=1" , "2!29" );
register_clcmd( "amx_tsay", "BlockAdminChat")
register_concmd("amx_tsay", "BlockAdminChat")
}
public BlockAdminChat(id){
client_print(id,print_chat,"Admin chatting is blocked right now.")
PLUGIN_HANDLED
}
fysiks.. I need to block it from another plugin.

Last edited by DPT; 02-09-2012 at 06:53.
DPT is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 02-09-2012 , 18:34   Re: blocking amx_tsay & amx_csay
Reply With Quote #5

You could add an xvar to adminchat.amxx and have it check if the function can be used. Then, in your other plugin, you just change that xvar to 0 when you want to disable it and back to 1 when you want to re-enable functionality.
__________________
fysiks is online now
DPT
Member
Join Date: Jun 2011
Old 02-11-2012 , 06:38   Re: blocking amx_tsay & amx_csay
Reply With Quote #6

fysiks.. I think thats the best solution.. Thank you for your time..
DPT 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 04:45.


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