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

[TF2 MvM] Chat Fix


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Theon32
Member
Join Date: Sep 2018
Location: mvm_isolation_rc3
Old 05-13-2019 , 08:23   [TF2 MvM] Chat Fix
Reply With Quote #1

So for some reason my chat on MvM is broken because I can't see the opposing team, but I was being told that it was a default behavior, so I tried making a plugin to fix it, but this issue happens:

I added a command listener for 'say' and while it does work, it doesn't hide any commands that start with '/', and no I don't wanna hide it if it starts with '/', only if it is a valid command.


Here's the code:
PHP Code:
public Action:Chat(client, const char[] commandint argc)
{
    if (
StrEqual(command"say_team") || StrEqual(command"say_party")) {return Plugin_Handled;}
    
int PlayerTeam GetClientTeam(client);
    new 
String:Args[128];
    
GetCmdArgString(Argssizeof(Args));
    
StripQuotes(Args);
    new 
String:cl_name[32];
    
GetClientName(clientcl_namesizeof(cl_name));
    new 
String:spec[8];

    if (
PlayerTeam == 1) {spec "*SPEC* ";}

    
CPrintToChatAllEx(client"%s{teamcolor}%s{default} :  %s"speccl_nameArgs);
    return 
Plugin_Handled;

Theon32 is offline
Kolapsicle
Senior Member
Join Date: Oct 2014
Old 05-13-2019 , 10:27   Re: [TF2 MvM] Chat Fix
Reply With Quote #2

You can use CommandExists to check if any text following a forward slash is registered before printing it to chat. You need to pass the full command (e.g. "sm_blind", not "blind").

Last edited by Kolapsicle; 05-13-2019 at 11:13.
Kolapsicle is offline
Theon32
Member
Join Date: Sep 2018
Location: mvm_isolation_rc3
Old 05-13-2019 , 10:45   Re: [TF2 MvM] Chat Fix
Reply With Quote #3

Cool, thanks! I'll see what I can do.
Theon32 is offline
Theon32
Member
Join Date: Sep 2018
Location: mvm_isolation_rc3
Old 05-13-2019 , 12:43   Re: [TF2 MvM] Chat Fix
Reply With Quote #4

I'm still new to some of this stuff, so how do I remove the forward slash from the beginning of the string?
Edit: Never mind, just used this:
PHP Code:
ReplaceString(Cmdsizeof(Cmd), "/"""false); 
Also, /equip or /mm doesn't hide from model manager.

Last edited by Theon32; 05-13-2019 at 14:08.
Theon32 is offline
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 05-13-2019 , 14:55   Re: [TF2 MvM] Chat Fix
Reply With Quote #5

😂😂😂
Attached Files
File Type: txt tf2.allchat.txt (185 Bytes, 60 views)
File Type: sp Get Plugin or Get Source (allchat.sp - 62 views - 1.4 KB)
__________________
Pelipoika is offline
Theon32
Member
Join Date: Sep 2018
Location: mvm_isolation_rc3
Old 05-13-2019 , 19:01   Re: [TF2 MvM] Chat Fix
Reply With Quote #6

Wait does this remove the team chat?
Theon32 is offline
Pelipoika
Veteran Member
Join Date: May 2012
Location: Inside
Old 05-13-2019 , 20:02   Re: [TF2 MvM] Chat Fix
Reply With Quote #7

no
__________________
Pelipoika is offline
Theon32
Member
Join Date: Sep 2018
Location: mvm_isolation_rc3
Old 05-14-2019 , 07:10   Re: [TF2 MvM] Chat Fix
Reply With Quote #8

Okay, thanks! I'll try it out.
Theon32 is offline
Reply


Thread Tools
Display Modes

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 06:31.


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