Earu / EasyChat

A modular Garry's Mod chat addon for both users and developers. (EOL 2025)
https://steamcommunity.com/sharedfiles/filedetails/?id=1182471500
GNU General Public License v3.0
90 stars 31 forks source link

EasyChat does not allow you to properly hide chat #110

Closed NovaAstral closed 1 year ago

NovaAstral commented 1 year ago

Using the 'PlayerSay' hook to hide chat with this addon installed (for example, hiding messages that begin with "/") does not send the chat message at all, which means you cannot hide command usage using an addon.

Cynosphere commented 1 year ago

Should work fine https://github.com/Earu/EasyChat/blob/5b8601ab82a0abdded61c6ea74b12bc386441366/lua/easychat/networking.lua#L498-L510

A reminder that PlayerSay is normally serverside only

NovaAstral commented 1 year ago

In my case, using hook.Add("PlayerSay","NVCmdHide",function(ply,text) if(string.StartWith(text,"/")) then return "" end end) in an addon to hide chats starting with /, hides it, but other addons, in this case Wiremod with Expression 2, cannot read the message sent with easychat installed This works fine when one does not have easychat installed

Cynosphere commented 1 year ago

You could try either of these hooks and see if they don't break compatibility https://github.com/Earu/EasyChat/blob/5b8601ab82a0abdded61c6ea74b12bc386441366/lua/easychat/networking.lua#L512-L520

NovaAstral commented 1 year ago

I'm not sure how to use them, I'm not exactly good at coding, just somewhat decent

Earu commented 1 year ago

Hi, seems to me what you want to do is hide after sending the message? If so you should look at OnPlayerChat, this is called after all the networking is done and the clients receive the message. It's also vanilla so it should work without EC too.

NovaAstral commented 1 year ago

Thank you that worked