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

[L4D/L4D2] No Team Chat


Post New Thread Reply   
 
Thread Tools Display Modes
Author
bullet28
Member
Join Date: Apr 2012
Plugin ID:
7029
Plugin Version:
2
Plugin Category:
General Purpose
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Redirecting all 'say_team' messages to 'say' in order to remove (Survivor) prefix when it's useless
    Old 04-06-2020 , 22:40   [L4D/L4D2] No Team Chat
    Reply With Quote #1

    Basically what this does is making your chat a little cleaner.

    Name:  result.jpg
Views: 2087
Size:  38.1 KB

    Should be used in gamemodes where there is only 1 playable team (coop, scavenge, etc)

    Updates history:
    31 January 2024: Uploaded improved version by HarryPotter
    09 April 2020: Switched to use 'OnClientSayCommand' (thanks to Marttt), added ignore list convar.
    Attached Files
    File Type: sp Get Plugin or Get Source (lfd_noTeamSay.sp - 26 views - 2.4 KB)

    Last edited by bullet28; 01-30-2024 at 21:00.
    bullet28 is offline
    zaviier
    Senior Member
    Join Date: Aug 2017
    Location: Indonesia
    Old 04-07-2020 , 11:48   Re: [L4D/L4D2] No Team Chat
    Reply With Quote #2

    Thanks... this is great for one team only.
    zaviier is offline
    Marttt
    Veteran Member
    Join Date: Jan 2019
    Location: Brazil
    Old 04-08-2020 , 16:47   Re: [L4D/L4D2] No Team Chat
    Reply With Quote #3

    Nice, good idea.

    Anyway I checked the code and you can do some improvements.

    Spoiler
    __________________

    Last edited by Marttt; 04-08-2020 at 16:51.
    Marttt is offline
    bullet28
    Member
    Join Date: Apr 2012
    Old 04-08-2020 , 17:07   Re: [L4D/L4D2] No Team Chat
    Reply With Quote #4

    Quote:
    Originally Posted by Marttt View Post
    Found an extra space while changing the say_team for say command, after the client name
    It is not extra, original message has same amount of spaces, if you remove it -- message will look different.

    Quote:
    Originally Posted by Marttt View Post
    Replace the "GetClientName" with "%N", unless there is some reason to do it.
    It is used for TrimString.. but reality is that trim should be removed too, so I do it.

    Quote:
    Originally Posted by Marttt View Post
    OnClientSayCommand(int client, const char[] command, const char[] sArgs)
    If it's really so important.. ok, I will use it.

    Quote:
    Originally Posted by Marttt View Post
    You could hide the "team chat" command for the sender, now it is displaying twice.
    What do you mean by "team chat command"? I never seen messages twice while using this plugin.

    Quote:
    Originally Posted by Marttt View Post
    Maybe you should remove the "@" prefix for this code, because if u are an admin, you are able to talk only with admins using @ prefix in team chat
    Ok, didn't knew about this prefix. I will add convar for those who has their own preferences.
    bullet28 is offline
    Marttt
    Veteran Member
    Join Date: Jan 2019
    Location: Brazil
    Old 04-08-2020 , 17:33   Re: [L4D/L4D2] No Team Chat
    Reply With Quote #5

    Quote:
    Originally Posted by bullet28 View Post
    It is not extra, original message has same amount of spaces, if you remove it -- message will look different.
    What I mean is that you are "double" spacing, instead just a single one.

    .Mart. : a (all chat)
    .Mart. : a (team chat)

    EDIT: I cant show here because SM removes double spacing from the post, but you can check what I mean by clicking in "quote"

    Quote:
    Originally Posted by bullet28 View Post
    What do you mean by "team chat command"? I never seen messages twice while using this plugin.
    I get this result because I have a plugin that makes !commands lowercase, probably is some conflict.
    I made a test removing the RegConsoleCmd and changing it to the Action OnClientSayCommand and it stopped.
    I also had to change the last line to Plugin_Stop; and check if the command var is "say_team"

    Anyway nice plugin, I just wanted to warn you about some stuff you could improve
    __________________

    Last edited by Marttt; 04-08-2020 at 17:37.
    Marttt is offline
    bullet28
    Member
    Join Date: Apr 2012
    Old 04-08-2020 , 18:24   Re: [L4D/L4D2] No Team Chat
    Reply With Quote #6

    Quote:
    Originally Posted by Marttt View Post
    I made a test removing the RegConsoleCmd and changing it to the Action OnClientSayCommand and it stopped
    Good. I have updated version to use OnClientSayCommand. Thank you!

    Quote:
    Originally Posted by Marttt View Post
    I mean is that you are "double" spacing, instead just a single one
    I have recorded for you a small video to show that I has exactly same amount of spaces as in original game. https://youtu.be/mtUomL5-ZNk Are you using L4D2 too?
    bullet28 is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 04-21-2020 , 07:05   Re: [L4D/L4D2] No Team Chat
    Reply With Quote #7

    I have this error in sourcemod 1.8 on local windows server
    Spoiler


    so I modify some codes, works for me.
    PHP Code:
    public void OnPluginStart() {
        
    AddCommandListener(TeamSay_Callback"say_team");
    .
    .
    }

    public 
    Action TeamSay_Callback(int client, const char[] commandint argc){
        if (!
    StrEqual(command"say_team"false))
            return 
    Plugin_Continue;

        if (
    client <= 0)
            return 
    Plugin_Continue;

        
    char msg[MAX_NAME_LENGTH];
        
    GetCmdArg(1msgsizeof(msg));

        for (
    int i 0sizeof ignoreListi++) {
            if (
    ignoreList[i][0] != EOS && StrContains(msgignoreList[i]) == 0) {
                return 
    Plugin_Continue;
            }
        }
        
        
    TrimString(msg);

        
    char buffer[256];
        
    Format(buffersizeof(buffer), "\x03%N\x01 :  %s"clientmsg);

        for (
    int i 1<= MaxClientsi++) {
            if (
    IsClientInGame(i) && !IsFakeClient(i)) {
                
    SayText2(iclientbuffer);
            }
        }

        return 
    Plugin_Handled;
    }

    /*
    public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs) {
        if (!StrEqual(command, "say_team", false))
            return Plugin_Continue;

        if (client <= 0)
            return Plugin_Continue;

        char msg[192];
        GetCmdArg(1, msg, sizeof(msg));

        for (int i = 0; i < sizeof ignoreList; i++) {
            if (ignoreList[i][0] != EOS && StrContains(msg, ignoreList[i]) == 0) {
                return Plugin_Continue;
            }
        }
        
        TrimString(msg);

        char buffer[256];
        Format(buffer, sizeof(buffer), "\x03%N\x01 :  %s", client, msg);

        for (int i = 1; i <= MaxClients; i++) {
            if (IsClientInGame(i) && !IsFakeClient(i)) {
                SayText2(i, client, buffer);
            }
        }

        return Plugin_Stop;
    }
    */ 
    __________________
    HarryPotter is offline
    Zheldorg
    Junior Member
    Join Date: Aug 2020
    Old 08-04-2020 , 15:47   Re: [L4D/L4D2] No Team Chat
    Reply With Quote #8

    I compiled using build "1.10.0.6492" but still got the error "[SM] Exception reported: No command callback available".
    I'm not sure if it's appropriate to call GetCmdArg () here, because already getting sArgs as chat argument string
    My fix option using this:
    PHP Code:
    public Action OnClientSayCommand(int client, const char[] command, const char[] sArgs) {
        if (!
    StrEqual(command"say_team"false))
            return 
    Plugin_Continue;

        if (
    client <= 0)
            return 
    Plugin_Continue;

        
    char msg[192];
        
    strcopy(msgsizeof(msg), sArgs);// replacement GetCmdArg(1, msg, sizeof(msg));
    //    GetCmdArg(1, msg, sizeof(msg)); // do error:
    /*
    L 08/04/2020 - 21:43:30: [SM] Exception reported: No command callback available
    L 08/04/2020 - 21:43:30: [SM] Blaming: lfd_noTeamSay.smx
    L 08/04/2020 - 21:43:30: [SM] Call stack trace:
    L 08/04/2020 - 21:43:30: [SM]   [0] GetCmdArg
    L 08/04/2020 - 21:43:30: [SM]   [1] Line 38, D:\ScmdServers\apps\l4d2\left4dead2\addons\sourcemod\scripting\lfd_noTeamSay.sp::OnClientSayCommand 
    */
        
    for (int i 0sizeof ignoreListi++) {
            if (
    ignoreList[i][0] != EOS && StrContains(msgignoreList[i]) == 0) {
                return 
    Plugin_Continue;
            }
        }
        
        
    TrimString(msg);

        
    char buffer[256];
        
    Format(buffersizeof(buffer), "\x03%N\x01 :  %s"clientmsg);

        for (
    int i 1<= MaxClientsi++) {
            if (
    IsClientInGame(i) && !IsFakeClient(i)) {
                
    SayText2(iclientbuffer);
            }
        }

        return 
    Plugin_Stop;

    Zheldorg is offline
    Marttt
    Veteran Member
    Join Date: Jan 2019
    Location: Brazil
    Old 04-08-2020 , 19:37   Re: [L4D/L4D2] No Team Chat
    Reply With Quote #9

    L4D2 Windows (Local Server), but no problem, thanks to check.
    __________________
    Marttt is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 09-15-2020 , 15:03   Re: [L4D/L4D2] No Team Chat
    Reply With Quote #10

    Remake
    https://github.com/fbef0102/L4D1_2-P.../lfd_noTeamSay
    __________________
    HarryPotter 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 05:20.


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