Raised This Month: $ Target: $400
 0% 

Blocking a command from appearing in chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
EpicKiller
Senior Member
Join Date: Jun 2014
Location: Constanta, Romania
Old 08-08-2014 , 11:02   Blocking a command from appearing in chat
Reply With Quote #1

Hi. I know that there is at least one topic regarding this subject, I've seen it a while ago, but I really can't find it now.

So, how can I block a chat text from appearing? I know it's something about getting the user's input, then returning PLUGIN_HANDLED, but I really can't remember how to get his chat input.
__________________
~ Swiftly and with style ~
EpicKiller is offline
Send a message via Yahoo to EpicKiller Send a message via Skype™ to EpicKiller
PreDominance
Member
Join Date: Jul 2014
Old 08-08-2014 , 11:05   Re: Blocking a command from appearing in chat
Reply With Quote #2

Well, every time a user wants to say something he has to run the command "say". Register the clcmd "say", and take it from there.

That said you could really just download almost ANY plugin and find it yourself.
PreDominance is offline
EpicKiller
Senior Member
Join Date: Jun 2014
Location: Constanta, Romania
Old 08-08-2014 , 11:11   Re: Blocking a command from appearing in chat
Reply With Quote #3

Ok. Thanks!
__________________
~ Swiftly and with style ~
EpicKiller is offline
Send a message via Yahoo to EpicKiller Send a message via Skype™ to EpicKiller
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 08-09-2014 , 12:22   Re: Blocking a command from appearing in chat
Reply With Quote #4

Mind that return PLUGIN_HANDLED_MAIN would be accurate in such situation as it wouldnt prevent other plugins from hooking the command.
mottzi is offline
Send a message via MSN to mottzi
EpicKiller
Senior Member
Join Date: Jun 2014
Location: Constanta, Romania
Old 08-09-2014 , 12:49   Re: Blocking a command from appearing in chat
Reply With Quote #5

Quote:
Originally Posted by mottzi View Post
Mind that return PLUGIN_HANDLED_MAIN would be accurate in such situation as it wouldnt prevent other plugins from hooking the command.
Oh. Well, I didn't know that. I'll keep that in mind, thank you!
__________________
~ Swiftly and with style ~
EpicKiller is offline
Send a message via Yahoo to EpicKiller Send a message via Skype™ to EpicKiller
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 08-10-2014 , 09:15   Re: Blocking a command from appearing in chat
Reply With Quote #6

I got some advice for you, since I just made this stuff
probably, you'll want all commands to start with "/"

you should make one plugin that handles all chat commands, and do something like:
register commands normally, register_clcmd("say /hello")
after registering all commands, register_clcmd("say", "stop_say")
PHP Code:
public stop_say(id)
{
    new 
message[129];
    
read_argv(1,message,128);
        if (
message[0]==47) return PLUGIN_HANDLED// 47 = ascii value for "/"

return PLUGIN_CONTINUE

This will stop everything beginning with / from being printed, but, will also stop other plugins below this plugin in plugins.ini from using slash commands. You also wanna sure you don't have other plugins above this one that handle messages (green admin names, ghostchat or whatever) basically any plugin that cancels default cstrike chat and prints messages manually by MSG_ALL
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.

Last edited by aron9forever; 08-10-2014 at 09:16.
aron9forever is offline
EpicKiller
Senior Member
Join Date: Jun 2014
Location: Constanta, Romania
Old 08-10-2014 , 11:01   Re: Blocking a command from appearing in chat
Reply With Quote #7

That's great! Thanks! I only needed the code to stop one command from appearing, it's kind of a hidden plugin, but I will use the code for all the commands, it's nicer. Thank you!
__________________
~ Swiftly and with style ~
EpicKiller is offline
Send a message via Yahoo to EpicKiller Send a message via Skype™ to EpicKiller
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 12:54.


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