PDA

View Full Version : Disable chat from IRIS rado.



Kin2InuYasha
24th November 2012, 18:09
Is there a way to disable the "We can kill it" or "Ugly mother" from showing up in chat when someone uses the IRIS radio? I want to disable all of them from showing up in chat, but still announce it.

Thanks.

Paegus
24th November 2012, 20:12
Sourcemod plugin to intercept say & say_team commands then if the phrase is typed, it returns Plugin_Handled to kill the output... something along the lines of:


/**
* Hidden:SourceMod - Chat Block
*
* Description:
* Blocks specific phrases from being send via text chat.
*
* Changelog:
* Initial release.
*
* Contact:
* Paegus: paegus@gmail.com
* SourceMod: http://www.sourcemod.net > Community > Forums > SourceMod
* Hidden:Source: http://www.hidden-source.com > Forums > Server Admins
*
*/

#define DEV

#define PLUGIN_VERSION "1.0.0"

#define MAX_CHAT_LENGTH 1024

#define HDN_TEAM_IRIS 2
#define HDN_TEAM_HIDDEN 3

new const String:cszPhrases[][] = {
"You are one UGLY mother!",
"If it bleeds, we can kill it!",
"Bring it!"
}

public Plugin:myinfo = {
name = "H:SM - Chat Block",
author = "Paegus",
description = "Blocks specific phrases from being send via text chat.",
version = PLUGIN_VERSION,
url = "http://forum.hidden-source.com/showthread.php?9853"
}

public OnPluginStart() {
CreateConVar(
"hsm_chatblock_version",
PLUGIN_VERSION,
"H:SM - Chat Block Version",
FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_NOTIFY
)

RegConsoleCmd("say", command_Say) // intercept say commands
}

public Action:command_Say(client, argc) {
if (!client) // Not a client
return Plugin_Continue // Nothing to see here.

decl String:szText[MAX_CHAT_LENGTH]
GetCmdArgString(szText, MAX_CHAT_LENGTH) // Get chat string

StripQuotes(szText) // Quote marks FTL

for (new i = 0; i < sizeof(cszPhrases); i++) // cycle through strings
if (StrContains(szText, cszPhrases[i], false) != -1) // match found
return Plugin_Handled // terminate chat message

return Plugin_Continue // no match found, carry on.
}

Kin2InuYasha
24th November 2012, 22:31
It works flawlessly, just how I wanted it. Thank you very much for this, I appreciate it.