Raised This Month: $ Target: $400
 0% 

Chat Hook, What's Wrong?


Post New Thread Reply   
 
Thread Tools Display Modes
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 11-24-2010 , 08:45   Re: Chat Hook, What's Wrong?
Reply With Quote #21

I'm basing my assumption off the comment here.

Quote:
/**
* If a say command is a silent chat trigger, and is used by an admin,
* but it does not evaluate to an actual command, it will be displayed
* publicly. This setting allows you to suppress accidental typings.
*
* The default value is "no". A value of "yes" will supress.
*/

"SilentFailSuppress" "yes"
Edit: I just tested and it does only block for admins...
__________________

Last edited by Silvers; 11-24-2010 at 08:50.
Silvers is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 11-24-2010 , 10:38   Re: Chat Hook, What's Wrong?
Reply With Quote #22

Oh I thought you meant it is printed for admins only, this was a mistake from me.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
comp_noob
Senior Member
Join Date: Nov 2010
Old 11-25-2010 , 00:10   Re: Chat Hook, What's Wrong?
Reply With Quote #23

Quote:
Originally Posted by Silvers View Post
PHP Code:
public OnPluginStart()
{
    
AddCommandListener(Command_Say"say");
}

public 
Action:Command_Say(client, const String:command[], argc)
{
    
decl String:argstring[256];
    
GetCmdArg(1argstringsizeof(argstring));
    if (
argstring[0] == '/')
        return 
Plugin_Handled;

    
PrintToServer("%N : %s"clientargstring);
    return 
Plugin_Continue;

This should do the trick.
Thank you very much silver! about the auto suppressing, i do not know why it failed to work, when i use addcommandlistener, it does not auto suppress the words that are behind /... because what i intended to do is to send my own message in my own style instead of the original message, the suppressing only works after my own message is sent and i used return Plugin_Continue, but i do not want to let the original message from displaying, so stopping it with return Plugin_Handled stops the suppressing of the silent command ONLY after my message is displayed, correct me if i'm wrong... anyway, other than the way of formatting message colours (like this: "\x03 this is an example."), because the codes from \x01 to \x08 does not include the team colour, blue when u are in survivor and red when u are in infected, is there any other way to add colours to your message?
comp_noob is offline
badwolf
Senior Member
Join Date: Apr 2010
Old 11-25-2010 , 09:32   Re: Chat Hook, What's Wrong?
Reply With Quote #24

http://forums.alliedmods.net/showthread.php?t=96831%22
badwolf is offline
bl4nk
SourceMod Developer
Join Date: Jul 2007
Old 11-25-2010 , 23:48   Re: Chat Hook, What's Wrong?
Reply With Quote #25

Just change your "return Plugin_Continue;" line to return Plugin_Handled instead.
bl4nk is offline
comp_noob
Senior Member
Join Date: Nov 2010
Old 11-26-2010 , 06:08   Re: Chat Hook, What's Wrong?
Reply With Quote #26

Quote:
Originally Posted by bl4nk View Post
Just change your "return Plugin_Continue;" line to return Plugin_Handled instead.
thank you very much! it worked indeed. and thanks, badwolf for the link!
comp_noob 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 10:09.


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