Raised This Month: $ Target: $400
 0% 

[Solved]Hide Chat Massages


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nhnkl159
Senior Member
Join Date: Jul 2012
Location: Israel 3>
Old 08-23-2015 , 20:57   [Solved]Hide Chat Massages
Reply With Quote #1

i try to Hide The Chat Massge with :

Code:
	
	decl String:text[128];
	GetCmdArgString(text, 128);
	TrimString(text);
	StripQuotes(text);
For Vote..

And Its Not Working.
I See The Chat Massages..
And Yes i Use It For say and say_team.
__________________

Last edited by nhnkl159; 08-23-2015 at 21:02.
nhnkl159 is offline
Send a message via Skype™ to nhnkl159
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 08-23-2015 , 21:28   Re: Hide Chat Massages
Reply With Quote #2

Use https://sm.alliedmods.net/new-api/co...ientSayCommand and return Plugin_Handled

Look at https://forums.alliedmods.net/showpo...15&postcount=9


btw.
decl String:text[128]; - declare new string variable named text
GetCmdArgString(text, 128); - put command arguments into variable text
TrimString(text); - remover leading and trailing spaces in variable text
StripQuotes(text); - remove quotes (only on first and last position in string) from variable text

there is nothing about blocking chat message.

Last edited by KissLick; 08-23-2015 at 21:34.
KissLick is offline
nhnkl159
Senior Member
Join Date: Jul 2012
Location: Israel 3>
Old 08-24-2015 , 06:13   Re: Hide Chat Massages
Reply With Quote #3

Quote:
Originally Posted by KissLick View Post
Use https://sm.alliedmods.net/new-api/co...ientSayCommand and return Plugin_Handled

Look at https://forums.alliedmods.net/showpo...15&postcount=9


btw.
decl String:text[128]; - declare new string variable named text
GetCmdArgString(text, 12; - put command arguments into variable text
TrimString(text); - remover leading and trailing spaces in variable text
StripQuotes(text); - remove quotes (only on first and last position in string) from variable text

there is nothing about blocking chat message.
i dont want to hide commands..

i want hide all the chat massages,
Like Numbers For Example..
__________________
nhnkl159 is offline
Send a message via Skype™ to nhnkl159
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 08-24-2015 , 06:38   Re: Hide Chat Massages
Reply With Quote #4

Quote:
Originally Posted by nhnkl159 View Post
i dont want to hide commands..

i want hide all the chat massages,
Like Numbers For Example..
Have you tried that? I didn't test it myself, but basecomm says that this forward does'n catch chat triggers.

Last edited by KissLick; 08-24-2015 at 06:38.
KissLick is offline
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 08-24-2015 , 06:39   Re: Hide Chat Massages
Reply With Quote #5

Quote:
Originally Posted by nhnkl159 View Post
i dont want to hide commands..

i want hide all the chat massages,
Like Numbers For Example..
PHP Code:
AddCommandListener(OnSay"say");
AddCommandListener(OnSay"say_team");

public 
Action:OnSay(int client, const char[] commandint argc)
{
decl String:text[128];
GetCmdArgString(textsizeof(text));
StripQuotes(text);
if(
StrEqual(text"Hideit"))
{
return 
Plugin_Handled;
}

That's block message
Code:
Hideit
__________________
SourcePawn, C# and C++ Programmer.

My plugin list
TheUnderTaker is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 08-24-2015 , 07:10   Re: Hide Chat Massages
Reply With Quote #6

Quote:
Originally Posted by TheUnderTaker View Post
PHP Code:
AddCommandListener(OnSay"say");
AddCommandListener(OnSay"say_team");

public 
Action:OnSay(int client, const char[] commandint argc)
{
decl String:text[128];
GetCmdArgString(textsizeof(text));
StripQuotes(text);
if(
StrEqual(text"Hideit"))
{
return 
Plugin_Handled;
}

That's block message
Code:
Hideit
Why you insist on using AddCommandListener(OnSay, "say"); and AddCommandListener(OnSay, "say_team"); ?

Last edited by KissLick; 08-24-2015 at 07:10.
KissLick is offline
TheUnderTaker
Senior Member
Join Date: Dec 2013
Location: Israel
Old 08-24-2015 , 07:30   Re: Hide Chat Massages
Reply With Quote #7

Quote:
Originally Posted by KissLick View Post
Why you insist on using AddCommandListener(OnSay, "say"); and AddCommandListener(OnSay, "say_team"); ?
Because if he means to curse, Why peoples allowed to curse in team chat?
__________________
SourcePawn, C# and C++ Programmer.

My plugin list
TheUnderTaker is offline
nhnkl159
Senior Member
Join Date: Jul 2012
Location: Israel 3>
Old 08-24-2015 , 07:33   Re: Hide Chat Massages
Reply With Quote #8

Quote:
Originally Posted by TheUnderTaker View Post
PHP Code:
AddCommandListener(OnSay"say");
AddCommandListener(OnSay"say_team");

public 
Action:OnSay(int client, const char[] commandint argc)
{
decl String:text[128];
GetCmdArgString(textsizeof(text));
StripQuotes(text);
if(
StrEqual(text"Hideit"))
{
return 
Plugin_Handled;
}

That's block message
Code:
Hideit
THX ! Solved !
__________________
nhnkl159 is offline
Send a message via Skype™ to nhnkl159
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 08-24-2015 , 09:09   Re: Hide Chat Massages
Reply With Quote #9

Quote:
Originally Posted by TheUnderTaker View Post
Because if he means to curse, Why peoples allowed to curse in team chat?
... Look at this code ;-)

PHP Code:
#include <sourcemod>

public Plugin:myinfo =
{
    
name "Test-OnClientSayCommand",
    
author "Raska",
    
description "Test OnClientSayCommand",
    
version "0.1",
    
url ""
}

public 
Action:OnClientSayCommand(client, const String:command[], const String:sArgs[])
{
    
decl String:sText[512];
    
strcopy(sTextsizeof(sText), sArgs);
    
StripQuotes(sText);
    
    
PrintToChatAll("Player %N used command '%s' and said '%s'"clientcommandsText);
    
    if (
StrEqual(sText"hideit")) {
        
PrintToChatAll("Stopped!");
        return 
Plugin_Handled;
    }
    
    if (
StrEqual(sText"!admin")) {
        
PrintToChatAll("Stopped!");
        return 
Plugin_Handled;
    }
    
    return 
Plugin_Continue;

And chat log:
PHP Code:
Player Raška used command 'say' and said 'test'
Raška test

Player Raška used command 
'say_team' and said 'test2'
(Counter-TerroristRaška CT Start :  test2

Player Raška used command 
'say' and said 'hideit'
Stopped!

Player Raška used command 'say_team' and said 'hideit'
Stopped!

Player Raška used command 'say' and said '!admin'
Stopped!
// and opened admin menu

Player Raška used command 'say_team' and said '!admin'
Stopped!
// and opened admin menu 
KissLick is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 08-24-2015 , 09:35   Re: Hide Chat Massages
Reply With Quote #10

Just found out that you don't need to strip quotes. And somehow I cant edit my post...

Last edited by KissLick; 12-04-2016 at 10:13.
KissLick 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 03:28.


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