Raised This Month: $51 Target: $400
 12% 

Optional Word Banlist


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheXeon
Member
Join Date: May 2016
Old 08-22-2017 , 05:04   Optional Word Banlist
Reply With Quote #1

An idea one of my server members had was to have an optional banlist on certain words in chat messages. A player would be able to enable and disable whether they want to see the words from other people or not. This is different than a global banlist for all clients, as it is not censoring the word for everybody, only those who opt-in. As a result, I can't just use a say and say_team. The idea is it'll work like any other game that has a profanity filter in client settings and will be completely optional to enable.

My initial idea was to use PrintToChat or CPrintToChat after a Regex filter, which would work in theory. However, it would be complicated to hook into an existing Shop's chat colors and all the other systems that might add their own colors in the future through CustomChatColors or whatnot.

And here is where I'm stuck. Is there a way to output different messages to different people, such as hooking into a text chat channel or something similar? I feel like I'm missing something right in front of me.
TheXeon is offline
TheXeon
Member
Join Date: May 2016
Old 08-22-2017 , 05:22   Re: Optional Word Banlist
Reply With Quote #2

Found this:

Code:
function Action(UserMsg msg_id, BfRead msg, const int[] players, int playersNum, bool reliable, bool init)
Putting it here as useful, but haven't the slightest how to use it. Anyone able to shed a bit of light onto this?
TheXeon is offline
Fyren
FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren FyrenFyrenFyrenFyrenFyren
Join Date: Feb 2106
Old 08-22-2017 , 10:09   Re: Optional Word Banlist
Reply With Quote #3

You posted the signature for a user message hook callback. You would write a function that returns an Action and takes those six things, then SM calls it when you hook a given user message and tell it to use your function as the callback. If you search the forum (or maybe wiki) for hooking user messages, you'll find more info.

CSGO uses protobufs instead of user messages.
Fyren is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode