UserMsg g_TextMsg, g_HintText, g_KeyHintText; static char g_sSpace[2048]; public Plugin myinfo = { name = "Fix Hint Color Messages", description = "Fix for PrintHintText and PrintCenterText colors msgs in csgo", author = "Phoenix (˙·٠●Феникс●٠·˙)", version = "1.2.2 Franc1sco franug github version", url = "https://github.com/Franc1sco/FixHintColorMessages" }; public void OnPluginStart() { for(int i = 0; i < sizeof g_sSpace - 1; i++) { g_sSpace[i] = ' '; } g_TextMsg = GetUserMessageId("TextMsg"); g_HintText = GetUserMessageId("HintText"); g_KeyHintText = GetUserMessageId("KeyHintText"); HookUserMessage(g_TextMsg, TextMsgHintTextHook, true); HookUserMessage(g_HintText, TextMsgHintTextHook, true); HookUserMessage(g_KeyHintText, TextMsgHintTextHook, true); } Action TextMsgHintTextHook(UserMsg msg_id, Protobuf msg, const int[] players, int playersNum, bool reliable, bool init) { static char sBuf[sizeof g_sSpace]; if(msg_id == g_HintText) { msg.ReadString("text", sBuf, sizeof sBuf); } else if(msg_id == g_KeyHintText) { msg.ReadString("hints", sBuf, sizeof sBuf, 0); } else if(msg.ReadInt("msg_dst") == 4) { msg.ReadString("params", sBuf, sizeof sBuf, 0); } else { return Plugin_Continue; } if(StrContains(sBuf, "(StartMessageEx(g_TextMsg, newClients, newTotal, USERMSG_RELIABLE|USERMSG_BLOCKHOOKS)); if(hMessage) { hMessage.SetInt("msg_dst", 4); hMessage.AddString("params", "#SFUI_ContractKillStart"); Format(sBuf, sizeof sBuf, "%s%s", sBuf, g_sSpace); hMessage.AddString("params", sBuf); hMessage.AddString("params", NULL_STRING); hMessage.AddString("params", NULL_STRING); hMessage.AddString("params", NULL_STRING); hMessage.AddString("params", NULL_STRING); EndMessage(); } }