View Single Post
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