Hello Guys,
I think its time that we need an 'chat processor' plugin with an api, so we can modify the chat by our own.
It would be great for ranking plugins, admin chat colors and more.
It should work for every game, which supports SayText2, since thats probably the most used one.
It should probably give other plugins the usage of:
- OnChatMessage
and
- OnChatMessagePost
Would be awesome if this exists.
EDIT:
After googling around, I saw that a new "Chat processor" plugin has been published on sourcemod forums, which is a new & fixed version of an older chat processor.
It supports every SayText2 game, and allows to easily modify names & messages.
https://forums.alliedmods.net/showthread.php?t=286913
https://github.com/Drixevel/Chat-Processor
Chat Processor
Re: Chat Processor
Sounds more like a custom package to me
But overall is a very nice idea, because chat modifying can turn out to be a very nested process with many little things that scripter would need to keep in mind. Having a custom package that handles it will help unify it.
But overall is a very nice idea, because chat modifying can turn out to be a very nested process with many little things that scripter would need to keep in mind. Having a custom package that handles it will help unify it.

My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam
Hail, Companion. [...] Hands to yourself, sneak thief.

Re: Chat Processor
Oh ye,
I actually meant custom package, but cause of the forum section name it was still in my mind :P
I actually meant custom package, but cause of the forum section name it was still in my mind :P
Re: Chat Processor
I'm interested in trying out this idea. But I'll need a usage example - I'm not sure, but maybe something like this:Or more like this:
Please tell me if I'm totally wrong with this or if this is what you would expect the package to do. :D
Syntax: Select all
from processors.chat import OnChatMessage
@OnChatMessage(cmd="votemap")
def on_chat_message_votemap(player, args):
if args:
# process args, e.g. directly add the first argument to the voting list if it is a correct map name
else:
# send VoteMap menu to player
# I'm not sure, but is HERE where you would call every OnChatMessagePost(cmd="votemap") function?
# ADMIN is not defined anywhere, it's just a hint of how it *could* work
@OnChatMessage(cmd="setmap", auth=ADMIN)
def on_chat_message_setmap(player, args):
# auth=ADMIN handles checking if the player typing the command is an actual admin
# tho this could be done using TypedSayCommand, but I'm currently not quite sure how
# change the map to the first argument if it is a correct map name
Syntax: Select all
from processors.chat import OnChatMessage
@OnChatMessage(cmd="votemap")
def on_chat_message_votemap(player, mapname):
# add the 'mapname' to the voting list
# it is an actual map name because ChatProcessor already figured that out in the background
Please tell me if I'm totally wrong with this or if this is what you would expect the package to do. :D
Re: Chat Processor
SayFilter and SayCommand?
While having read viewtopic.php?f=20&t=1138
Why is an additional library needed?
While having read viewtopic.php?f=20&t=1138
Why is an additional library needed?
Re: Chat Processor
You guys probably understood it wrong. The main thing of the plugin would be the modification of a "player chat message".
A example code from the sourcemod version is that you can use:
as an example
EDIT:
first of all, it would support all games (You can see I want to use this for CS:S & CS:GO, but both versions use different message things like protobuf etc) and i rather want to have a custom package for this. (API)
A example code from the sourcemod version is that you can use:
Code: Select all
public Action OnChatMessage(int& author, Handle recipients, eChatFlags& flag, char[] name, char[] message, bool& bProcessColors, bool& bRemoveColors)
{
Format(name, MAXLENGTH_NAME, "{red}%s", name);
Format(message, MAXLENGTH_MESSAGE, "{blue}%s", message);
return Plugin_Changed;
}
public void OnChatMessagePost(int author, Handle recipients, eChatFlags flag, const char[] name, const char[] message, bool bProcessColors, bool bRemoveColors)
{
PrintToServer("[TEST] %s: %s [%b/%b]", name, message, bProcessColors, bRemoveColors);
}
as an example
EDIT:
first of all, it would support all games (You can see I want to use this for CS:S & CS:GO, but both versions use different message things like protobuf etc) and i rather want to have a custom package for this. (API)
Re: Chat Processor
I'd rather make it so the callback function would return the new message or a tuple defining a new message (cause as far as I remember, message can be defined in both message name and one of the params).

My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam
Hail, Companion. [...] Hands to yourself, sneak thief.

Re: Chat Processor
iPlayer wrote:I'd rather make it so the callback function would return the new message or a tuple defining a new message (cause as far as I remember, message can be defined in both message name and one of the params).
Let's compete :D haha
Who is online
Users browsing this forum: Bing [Bot] and 101 guests