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_id, Handle:msg, const players[], playersNum, bool:reliable, bool:init)
{
if(!g_iEnabled)
return Plugin_Continue;
decl String:sBuffer[64], String:sResult[64];
new iRepeat = PbGetRepeatedFieldCount(msg, "params");
for(new i = 0; i < iRepeat; i++)
{
PbReadString(msg, "params", sBuffer, sizeof(sBuffer), i);
if(StrEqual(sBuffer, ""))
continue;
if(g_iMethodNotifications & cEventPhrase)
{
for(new j = 0; j < g_iTotalHiddenPhrases; j++)
{
GetArrayString(g_hArray_HiddenPhrase, j, sResult, sizeof(sResult));
if(StrContains(sBuffer, sResult) != -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_SM, sPath, sizeof(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(hKeyValues, true);
if(FileToKeyValues(hKeyValues, sPath) && KvGotoFirstSubKey(hKeyValues))
{
decl String:sResult[64];
g_iTotalHiddenPhrases = 0;
KvGotoFirstSubKey(hKeyValues, false);
do
{
KvGetSectionName(hKeyValues, sResult, sizeof(sResult));
PushArrayString(g_hArray_HiddenPhrase, sResult);
g_iTotalHiddenPhrases++;
}
while(KvGotoNextKey(hKeyValues, false));
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" ""
}
}
__________________