View Single Post
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 07-30-2014 , 00:02   Re: [CS:GO] Block "Saved Player" Text
Reply With Quote #2

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*. 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"                ""
    
}

__________________

Last edited by thetwistedpanda; 07-30-2014 at 00:26.
thetwistedpanda is offline