This is my first plugin attempt
.
PHP Code:
#include <sourcemod>
#include <sdktools>
#define PLUGIN_VERSION "1.0"
public Plugin:myinfo =
{
name = "L4D Vocalize Blocker",
author = "B-Man",
description = "Blocks vocalize command",
version = PLUGIN_VERSION,
url = "http://www.tchalo.com"
}
public OnPluginStart()
{
RegConsoleCmd("vocalize", vocal_stop);
CreateConVar("l4d_vocalize_block_v", PLUGIN_VERSION, "L4D Vocalize Blocker Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY);
}
public Action:vocal_stop(client, args)
{
PrintToChat(client, "[SM] Vocalize command is blocked");
return Plugin_Handled;
}
This works, just not as intended. It will block the command but it also blocks anything that calls the vocalize command, like in the radial menu and when the computer does any of the vocalize stuff.
Is there a way to check to see if this was a command input manually in the console or called from somewhere else?