AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [CS:GO] Block "Saved Player" Text (https://forums.alliedmods.net/showthread.php?t=245227)

Mitchell 07-29-2014 23:52

[CS:GO] Block "Saved Player" Text
 
1 Attachment(s)
What: blocks the "Player 1 saved player 2" text from chat.
Why: because the text was pretty distracting, especially for servers that actually want players to communicate through chat...
How: hooks the TextMsg and checks if it contains "SavedPlayer" if so then return it.

[IMG]http://s17.************/mw8ppzedb/2014_07_29_00001.jpg[/IMG]

thetwistedpanda 07-30-2014 00:02

Re: [CS:GO] Block "Saved Player" Text
 
Hmph! Bad Mitchell! I was a few hours away from releasing a portion of my CS:GO Idle plugin that does the same thing, but with a simple KV configuration that let users pick input which TextMsgs they wanted to block vs hardcoding one. You should totally save me the hassle of supporting such a plugin by tweaking yours a little *nudge nudge*. :3 Also, Hi!

*Edit*

PHP Code:

public Action:UserMessageHook_Text(UserMsg:msg_idHandle:msg, const players[], playersNumbool:reliablebool:init)
{
    if(!
g_iEnabled)
        return 
Plugin_Continue;

    
decl String:sBuffer[64], String:sResult[64];
    new 
iRepeat PbGetRepeatedFieldCount(msg"params");
    for(new 
0iRepeati++)
    {
        
PbReadString(msg"params"sBuffersizeof(sBuffer), i);
        if(
StrEqual(sBuffer""))
            continue;

        if(
g_iMethodNotifications cEventPhrase)
        {
            for(new 
0g_iTotalHiddenPhrasesj++)
            {
                
GetArrayString(g_hArray_HiddenPhrasejsResultsizeof(sResult));
                if(
StrContains(sBuffersResult) != -1)
                    return 
Plugin_Handled;
            }
        }
    }

    return 
Plugin_Continue;
}

Define_Phrases()
{
    if(
g_hArray_HiddenPhrase == INVALID_HANDLE)
        
g_hArray_HiddenPhrase CreateArray(16);
    else
        
ClearArray(g_hArray_HiddenPhrase);

    
decl String:sPath[PLATFORM_MAX_PATH];
    
BuildPath(Path_SMsPathsizeof(sPath), g_sPathPhrases);

    if(!
FileExists(sPath))
    {
        if(
g_iEnabled == 2)
            
LogToFile(g_sPluginLog"[CONFIG.ERROR] Hidden Phrases System - %s - File Not Found"sPath);

        
LogError("[Idle Manager][CONFIG.ERROR] Hidden Phrases System - %s - File Not Found"sPath);
        return 
false;
    }

    new 
Handle:hKeyValues CreateKeyValues("Idle.Configs");
    
KvSetEscapeSequences(hKeyValuestrue);
    if(
FileToKeyValues(hKeyValuessPath) && KvGotoFirstSubKey(hKeyValues))
    {
        
decl String:sResult[64];
        
g_iTotalHiddenPhrases 0;
        
KvGotoFirstSubKey(hKeyValuesfalse);
        do
        {
            
KvGetSectionName(hKeyValuessResultsizeof(sResult));
            
PushArrayString(g_hArray_HiddenPhrasesResult);

            
g_iTotalHiddenPhrases++;
        }
        while(
KvGotoNextKey(hKeyValuesfalse));

        return 
true;
    }

    return 
false;


PHP Code:

"Idle.Phrases"
{
    
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
    //TextMsg Phrases defined below will not appear for any client if it is detected.
    //- This is not for messages sent by players, but rather internal game communication that players receive.
    //- You can find these strings within /csgo/resource/csgo_english.txt
    //
    //- Hidden Phrases preforms a StrContains check, in other words, it checks the header of the phrase
    //-- for any of the below messages. If the header contains any of the character combinations below,
    //-- the message will be blocked from clients.
    //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

    
"Phrases"
    
{
        
//Remove any reward spam players receive for killing a player.
        
"Player_Cash_Award"                            ""
        "Team_Cash_Award"                            ""
        "Player_Point_Award"                        ""

        
//Player attacked a teammate messages.
        
"Cstrike_TitlesTXT_Game_teammate_attack"    ""

        
//Player has been saved by another player.
        
"Chat_SavePlayer_"                            ""

        
//Player has joined a team messages.
        
"Cstrike_game_join_"                        ""

        
//If you're running DeathMatch, remove some spam about weapons / domination.
        //"SFUI_Notice_DM_BonusRespawn"                ""
        //"SFUI_Notice_DM_BonusSwitchTo"            ""
        //"SFUI_Notice_DM_BonusWeaponText"            ""
        //"Player_You_Are_"                            ""

        //Warmup currently in progress messages.
        
"SFUI_Notice_Match_Will_Start_Chat"            ""
        "SFUI_Notice_Warmup_Has_Ended"                ""

        
//Coaching. Why would you want coaching for Idle?
        
"CSGO_Coach_Join_"                            ""
        "CSGO_No_Longer_Coach"                        ""
        
        
//Dominating / Killing Sprees
        
"Player_You_Are_Now_Dominating"                ""
        "Player_You_Are_Still_Dominating"            ""
        "Player_On_Killing_Spree"                    ""
        "hostagerescuetime"                            ""
        
        
//Buymenu!
        
"csgo_instr_explain_buymenu"                ""
    
}



Mitchell 07-30-2014 00:17

Re: [CS:GO] Block "Saved Player" Text
 
Quote:

Originally Posted by thetwistedpanda (Post 2176035)
Hmph! Bad Mitchell! I was a few hours away from releasing a portion of my CS:GO Idle plugin that does the same thing, but with a simple KV configuration that let users pick input which TextMsgs they wanted to block vs hardcoding one. You should totally save me the hassle of supporting such a plugin by tweaking yours a little *nudge nudge*. :3 Also, Hi!

if ya want me to i can! haha. i was looking at this cause i was just getting annoyed seeing a guy with "WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW" saving players etc.
I can add an config like i do with Super Targeting!
I would also need to make it Bitbuffer and Protobuf supported too then huh?

thetwistedpanda 07-30-2014 00:28

Re: [CS:GO] Block "Saved Player" Text
 
I threw a copy/paste in my above post, essentially what I was going to post after I removed my plugin-specific content, but since I'm not fancy on coding beyond fixing this plugin up, by all means use what you want so I don't have to help people with it xD.

TUSK3N1337 07-30-2014 11:18

Re: [CS:GO] Block "Saved Player" Text
 
Thanks really needed.

Ejziponken 07-30-2014 11:38

Re: [CS:GO] Block "Saved Player" Text
 
It crashes the servers.

Mitchell 07-30-2014 14:04

Re: [CS:GO] Block "Saved Player" Text
 
Quote:

Originally Posted by Ejziponken (Post 2176254)
It crashes the servers.

A little bit more information would be nice about this.
Like:
sm version
meta version

any error logs... referencing this plugin.

PresidentEvil 08-10-2014 21:02

Re: [CS:GO] Block "Saved Player" Text
 
Quote:

Originally Posted by Mitchell (Post 2176302)
A little bit more information would be nice about this.
Like:
sm version
meta version

any error logs... referencing this plugin.

i had a crash, these were the last things in the logs, when a player was killed by another player(possible saving a player)

Code:

L 08/10/2014 - 17:45:24: "johnyyboii<133><STEAM_1:1:93855704><CT>" say "rpg"
L 08/10/2014 - 17:45:29: "Vulcano.<164><STEAM_1:1:59925726><TERRORIST>" [-3037 3749 -512] killed "[Forget]Alex58301<141><STEAM_1:0:47581943><CT>" [-2956 3756 -448] with "deagle" (headshot)
Wrote minidump to: /servers/slayerssurf/csgo/addons/sourcemod/data/dumps/47ce9b2c-a699-445a-16f88d39-2e85ddd0.dmp
./exec_slayerssurf.run: line 318: 10546 Segmentation fault      (core dumped) $HL_CMD


I didn't see any errors in the error logs referencing other plugins, thought it might be this plugin

Mitchell 08-19-2014 08:56

Re: [CS:GO] Block "Saved Player" Text
 
Quote:

Originally Posted by PresidentEvil (Post 2182254)
i had a crash, these were the last things in the logs, when a player was killed by another player(possible saving a player)
...
I didn't see any errors in the error logs referencing other plugins, thought it might be this plugin

I cant seem to replicate this crash, is it still happening, or did you remove the plugin after the crash?

TUSK3N1337 08-19-2014 13:57

Re: [CS:GO] Block "Saved Player" Text
 
This plugin does not crash any server I have been running this since it was released and not crashed for me a single time, if anyone else gets crashes from this plugin then mabye another plugin is in conflict with this plugin.


All times are GMT -4. The time now is 09:19.

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