Hide chat triggers

Started by st0ka
30 Sep 2007, 16:24
Page 1 of 1
30 Sep 2007, 16:24

Is there a plugin that can hide chat triggers as /ljstats /lj15 /ct /spec in (stored in hidetriggers.txt for example) cuz it's especially the /ljstats spam is really annoying. I couldn't find anything but sourcemod plugins :/

12 Oct 2007, 14:24

Recompile the plugins, and change the return at the end of the functions called for those commands from

return PLUGIN_CONTINUE

to

return PLUGIN_HANDLED

12 Oct 2007, 17:12

i was bored so i made this ^^
http://www.sendspace.com/file/8l6512
read the readme for instructions... anyway it does hide the triggers and is easy to use. did not test it that much so it might be buggy (if i forget something) xD

12 Oct 2007, 17:59

thank you :) gonna try it :>
EDIT: works perfectly :up:
P.S. it doesn't work with colorchat plugin (i guess you already know that) but it's not a problem since i tested it on my local server and i don't use this plugin in my public one ;>
P.S.2 if you're interested here's a one ported over amxmodx from sm by alka .sma
[ Edited 10/12/07 - 18:26:00 ]

12 Oct 2007, 18:56

u mean it does not work if u use a plugin which makes ur chattext green for ex.?

12 Oct 2007, 20:03

well both plugins doesn't work with this plugin http://forums.alliedmods.net/showthread.php?t=52830&highlight=color+text

13 Oct 2007, 00:03

because that plugin catches the say and send it as a serverMESSAGE!... sry but idk how to fix that bug :( but i could modify that plugin

13 Oct 2007, 00:56

you made enough :> though it would be nice if you can modify it :)

13 Oct 2007, 00:58

It can be fixed by recoding, but the easier way to do it would be to reorder the plugins in your plugins.ini. The plugins execute in the order that they appear in the plugins.ini, so if you put the plugins with the chat triggers first, then the trigger blocking plugin, then the color chat plugin, it should give you the result you're looking for.

13 Oct 2007, 01:40

dont think so cause the message is send in the function and then the normal input is handled.

13 Oct 2007, 02:03

When an event happens in the game, AMXX runs it through any loaded plugins in the order that they are loaded, then runs it through the game dll. If a plugin uses 'return PLUGIN_HANDLED' AMXX kills that event, it no longer executes in any of the remaining plugins on the list, and never makes it to the game dll. So order does matter.

25 Feb 2008, 09:19

upload again pls :|

28 Feb 2008, 13:27

SchlumpF's plugin:


#include
#include

#define PLUGIN "Hide Chattriggers"
#define VERSION "1.0"
#define AUTHOR "SchlumPF"

new file[128]

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_clcmd("say", "blocktrigger")
//register_clcmd("say_team", "blocktrigger")

new cfgdir[128]
get_configsdir(cfgdir, 127)
format(file, 127, "%s/triggers.txt", cfgdir)
}

public blocktrigger(id)
{
static message[192]
read_args(message,191)
remove_quotes(message)

if (file_exists(file))
{
new line, stxtsize
new data[64]
new triggername[32]

while ((line = read_file(file, line, data, 63, stxtsize)) != 0)
{
parse(data, triggername, 31)

if (equal(message, triggername))
return PLUGIN_HANDLED
}
}

return PLUGIN_CONTINUE
}

You should create triggers.txt in your configs folder and add the commands you don't want to be shown.
Alka's:

#include
#include

#define PLUGIN "HideChatTiggers"
#define VERSION "1.0"
#define AUTHOR "Alka"

#define MAXIM_WORDS 150
#define MAXIM_LEN 20

new
g_words[MAXIM_WORDS][MAXIM_LEN],
g_words_num;

public plugin_init() {

register_plugin(PLUGIN, VERSION, AUTHOR);

register_clcmd("say","Hook_Say");
register_clcmd("say_team","Hook_Say");

}

public plugin_cfg()
{
new g_configsdir[64], g_words_file[64];
get_configsdir(g_configsdir, 63);

format(g_words_file, sizeof g_words_file - 1, "%s/chatwordstiggers.ini",g_configsdir);

if (!file_exists(g_words_file))
{
write_file(g_words_file,";Chat Word Tiggers File;^n^n");
return;
}

new len, i;
while(i < MAXIM_WORDS && read_file(g_words_file, i , g_words[g_words_num], MAXIM_LEN - 1, len))
{
i++;
if(g_words[g_words_num][0] == ';' || len == 0)
continue;

g_words_num++;
}
}

public Hook_Say(id)
{
static Buffer[256];
read_args(Buffer, sizeof Buffer - 1);

new i;
while (i < g_words_num)
{
if (containi(Buffer, g_words[i++] ) != -1 )
{
return 1;
}
}
return 0;
}

This one will automatically create chatwordstiggers.ini and you can add there the cmds.

28 Feb 2008, 13:58

alkas should be better btw cause it does use less resource. as i said in the thread above i made that pluginc ause i was bored so i just wrote it within 5min

28 Feb 2008, 16:28

:D thx st0ka

Page 1 of 1

Reply

Please log in to post replies.