View Single Post
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 01-20-2014 , 15:13   Re: [CSGO] HookUserMessage
Reply With Quote #18

As far as I know SayText2 is player chat, SayText (used as player chat in ep1 and DoD:S btw) in CS:GO used as radio messages/other colored messages (just my guesses, never used it) and TextMsg as default messages (such as PrintToChat and others).
EDIT: you can try something like this.
Code:
new UserMsg:TextMsg, UserMsg:SayText, UserMsg:SayText2 public OnPluginStart() {     TextMsg  = GetUserMessageId("TextMsg")     SayText  = GetUserMessageId("SayText")     SayText2 = GetUserMessageId("SayText2")     HookUserMessage(TextMsg,  UserMessagesHook, true)     HookUserMessage(SayText,  UserMessagesHook, true)     HookUserMessage(SayText2, UserMessagesHook, true) } public Action:UserMessagesHook(UserMsg:msg_id, Handle:msg, const players[], playersNum, bool:reliable, bool:init) {     decl String:buffer[PLATFORM_MAX_PATH], String:szMsgId[32]     for (new i; i < PbGetRepeatedFieldCount(msg, "params"); i++)     {         PbReadString(msg, "params", buffer, sizeof(buffer), i)         if (msg_id == TextMsg)             Format(szMsgId, sizeof(szMsgId), "TextMsg")         if (msg_id == SayText)             Format(szMsgId, sizeof(szMsgId), "SayText")         if (msg_id == SayText2)             Format(szMsgId, sizeof(szMsgId), "SayText2")         PrintCenterText(players[0], "msg_id %s, params %s", szMsgId, buffer)         LogMessage("msg_id %s, params %s", szMsgId, buffer)     } }
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot

Last edited by Root_; 01-20-2014 at 15:22.
Root_ is offline