2008-03-30 09:00:22 +02:00
|
|
|
/**
|
|
|
|
* vim: set ts=4 :
|
|
|
|
* =============================================================================
|
|
|
|
* SourceMod Basecomm
|
|
|
|
* Part of Basecomm plugin, menu and other functionality.
|
|
|
|
*
|
|
|
|
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
|
|
|
|
* =============================================================================
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it under
|
|
|
|
* the terms of the GNU General Public License, version 3.0, as published by the
|
|
|
|
* Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
* details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* As a special exception, AlliedModders LLC gives you permission to link the
|
|
|
|
* code of this program (as well as its derivative works) to "Half-Life 2," the
|
|
|
|
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
|
|
|
|
* by the Valve Corporation. You must obey the GNU General Public License in
|
|
|
|
* all respects for all other code used. Additionally, AlliedModders LLC grants
|
|
|
|
* this exception to all derivative works. AlliedModders LLC defines further
|
|
|
|
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
|
|
|
|
* or <http://www.sourcemod.net/license.php>.
|
|
|
|
*
|
2008-04-11 19:16:36 +02:00
|
|
|
* Version: $Id$
|
2008-03-30 09:00:22 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
enum CommType
|
|
|
|
{
|
|
|
|
CommType_Mute,
|
|
|
|
CommType_UnMute,
|
|
|
|
CommType_Gag,
|
|
|
|
CommType_UnGag,
|
|
|
|
CommType_Silence,
|
|
|
|
CommType_UnSilence
|
|
|
|
};
|
|
|
|
|
|
|
|
DisplayGagTypesMenu(client)
|
|
|
|
{
|
2014-11-16 01:30:45 +01:00
|
|
|
Menu menu = CreateMenu(MenuHandler_GagTypes);
|
2008-03-30 09:00:22 +02:00
|
|
|
|
|
|
|
decl String:title[100];
|
2009-03-01 22:51:15 +01:00
|
|
|
Format(title, sizeof(title), "%T: %N", "Choose Type", client, g_GagTarget[client]);
|
2014-11-16 01:30:45 +01:00
|
|
|
menu.SetTitle(title);
|
|
|
|
menu.ExitBackButton = true;
|
2008-03-30 09:00:22 +02:00
|
|
|
|
|
|
|
new target = g_GagTarget[client];
|
|
|
|
|
|
|
|
if (!g_Muted[target])
|
|
|
|
{
|
2013-04-08 14:00:13 +02:00
|
|
|
AddTranslatedMenuItem(menu, "0", "Mute Player", client);
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-04-08 14:00:13 +02:00
|
|
|
AddTranslatedMenuItem(menu, "1", "UnMute Player", client);
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!g_Gagged[target])
|
|
|
|
{
|
2013-04-08 14:00:13 +02:00
|
|
|
AddTranslatedMenuItem(menu, "2", "Gag Player", client);
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-04-08 14:00:13 +02:00
|
|
|
AddTranslatedMenuItem(menu, "3", "UnGag Player", client);
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!g_Muted[target] || !g_Gagged[target])
|
|
|
|
{
|
2013-04-08 14:00:13 +02:00
|
|
|
AddTranslatedMenuItem(menu, "4", "Silence Player", client);
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2013-04-08 14:00:13 +02:00
|
|
|
AddTranslatedMenuItem(menu, "5", "UnSilence Player", client);
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
|
2014-11-16 01:30:45 +01:00
|
|
|
menu.Display(client, MENU_TIME_FOREVER);
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
|
2014-11-16 01:30:45 +01:00
|
|
|
void AddTranslatedMenuItem(Menu menu, const char[] opt, const char[] phrase, int client)
|
2013-04-08 14:00:13 +02:00
|
|
|
{
|
2014-11-16 01:30:45 +01:00
|
|
|
char buffer[128];
|
2013-04-08 14:00:13 +02:00
|
|
|
Format(buffer, sizeof(buffer), "%T", phrase, client);
|
2014-11-16 01:30:45 +01:00
|
|
|
menu.AddItem(opt, buffer);
|
2013-04-08 14:00:13 +02:00
|
|
|
}
|
|
|
|
|
2014-11-16 01:30:45 +01:00
|
|
|
void DisplayGagPlayerMenu(int client)
|
2008-03-30 09:00:22 +02:00
|
|
|
{
|
2014-11-16 01:30:45 +01:00
|
|
|
Menu menu = CreateMenu(MenuHandler_GagPlayer);
|
2008-03-30 09:00:22 +02:00
|
|
|
|
2014-11-16 01:30:45 +01:00
|
|
|
char title[100];
|
2008-03-30 09:00:22 +02:00
|
|
|
Format(title, sizeof(title), "%T:", "Gag/Mute player", client);
|
2014-11-16 01:30:45 +01:00
|
|
|
menu.SetTitle(title);
|
|
|
|
menu.ExitBackButton = true;
|
2008-03-30 09:00:22 +02:00
|
|
|
|
|
|
|
AddTargetsToMenu(menu, client, true, false);
|
|
|
|
|
2014-11-16 01:30:45 +01:00
|
|
|
menu.Display(client, MENU_TIME_FOREVER);
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public AdminMenu_Gag(Handle:topmenu,
|
|
|
|
TopMenuAction:action,
|
|
|
|
TopMenuObject:object_id,
|
|
|
|
param,
|
|
|
|
String:buffer[],
|
|
|
|
maxlength)
|
|
|
|
{
|
|
|
|
if (action == TopMenuAction_DisplayOption)
|
|
|
|
{
|
|
|
|
Format(buffer, maxlength, "%T", "Gag/Mute player", param);
|
|
|
|
}
|
|
|
|
else if (action == TopMenuAction_SelectOption)
|
|
|
|
{
|
|
|
|
DisplayGagPlayerMenu(param);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-16 01:30:45 +01:00
|
|
|
public MenuHandler_GagPlayer(Menu menu, MenuAction action, int param1, int param2)
|
2008-03-30 09:00:22 +02:00
|
|
|
{
|
|
|
|
if (action == MenuAction_End)
|
|
|
|
{
|
2014-11-16 01:30:45 +01:00
|
|
|
delete menu;
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
else if (action == MenuAction_Cancel)
|
|
|
|
{
|
2014-10-29 03:03:38 +01:00
|
|
|
if (param2 == MenuCancel_ExitBack && hTopMenu)
|
2008-03-30 09:00:22 +02:00
|
|
|
{
|
2014-10-29 03:03:38 +01:00
|
|
|
hTopMenu.Display(param1, TopMenuPosition_LastCategory);
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (action == MenuAction_Select)
|
|
|
|
{
|
|
|
|
decl String:info[32];
|
|
|
|
new userid, target;
|
|
|
|
|
2014-11-16 01:30:45 +01:00
|
|
|
menu.GetItem(param2, info, sizeof(info));
|
2008-03-30 09:00:22 +02:00
|
|
|
userid = StringToInt(info);
|
|
|
|
|
|
|
|
if ((target = GetClientOfUserId(userid)) == 0)
|
|
|
|
{
|
|
|
|
PrintToChat(param1, "[SM] %t", "Player no longer available");
|
|
|
|
}
|
|
|
|
else if (!CanUserTarget(param1, target))
|
|
|
|
{
|
|
|
|
PrintToChat(param1, "[SM] %t", "Unable to target");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_GagTarget[param1] = GetClientOfUserId(userid);
|
|
|
|
DisplayGagTypesMenu(param1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-11-16 01:30:45 +01:00
|
|
|
public MenuHandler_GagTypes(Menu menu, MenuAction action, int param1, int param2)
|
2008-03-30 09:00:22 +02:00
|
|
|
{
|
|
|
|
if (action == MenuAction_End)
|
|
|
|
{
|
2014-11-16 01:30:45 +01:00
|
|
|
delete menu;
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
else if (action == MenuAction_Cancel)
|
|
|
|
{
|
2014-10-29 03:03:38 +01:00
|
|
|
if (param2 == MenuCancel_ExitBack && hTopMenu)
|
2008-03-30 09:00:22 +02:00
|
|
|
{
|
2014-10-29 03:03:38 +01:00
|
|
|
hTopMenu.Display(param1, TopMenuPosition_LastCategory);
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (action == MenuAction_Select)
|
|
|
|
{
|
|
|
|
decl String:info[32];
|
|
|
|
new CommType:type;
|
|
|
|
|
2014-11-16 01:30:45 +01:00
|
|
|
menu.GetItem(param2, info, sizeof(info));
|
2008-03-30 09:00:22 +02:00
|
|
|
type = CommType:StringToInt(info);
|
|
|
|
|
|
|
|
decl String:name[MAX_NAME_LENGTH];
|
|
|
|
GetClientName(g_GagTarget[param1], name, sizeof(name));
|
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case CommType_Mute:
|
|
|
|
{
|
|
|
|
PerformMute(param1, g_GagTarget[param1]);
|
|
|
|
ShowActivity2(param1, "[SM] ", "%t", "Muted target", "_s", name);
|
|
|
|
}
|
|
|
|
case CommType_UnMute:
|
|
|
|
{
|
|
|
|
PerformUnMute(param1, g_GagTarget[param1]);
|
|
|
|
ShowActivity2(param1, "[SM] ", "%t", "Unmuted target", "_s", name);
|
|
|
|
}
|
|
|
|
case CommType_Gag:
|
|
|
|
{
|
|
|
|
PerformGag(param1, g_GagTarget[param1]);
|
|
|
|
ShowActivity2(param1, "[SM] ", "%t", "Gagged target", "_s", name);
|
|
|
|
}
|
|
|
|
case CommType_UnGag:
|
|
|
|
{
|
|
|
|
PerformUnGag(param1, g_GagTarget[param1]);
|
|
|
|
ShowActivity2(param1, "[SM] ", "%t", "Ungagged target", "_s", name);
|
|
|
|
}
|
|
|
|
case CommType_Silence:
|
|
|
|
{
|
|
|
|
PerformSilence(param1, g_GagTarget[param1]);
|
|
|
|
ShowActivity2(param1, "[SM] ", "%t", "Silenced target", "_s", name);
|
|
|
|
}
|
|
|
|
case CommType_UnSilence:
|
|
|
|
{
|
|
|
|
PerformUnSilence(param1, g_GagTarget[param1]);
|
|
|
|
ShowActivity2(param1, "[SM] ", "%t", "Unsilenced target", "_s", name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-07-07 04:34:21 +02:00
|
|
|
PerformMute(client, target, bool:silent=false)
|
2008-03-30 09:00:22 +02:00
|
|
|
{
|
|
|
|
g_Muted[target] = true;
|
2012-09-03 21:45:11 +02:00
|
|
|
SetClientListeningFlags(target, VOICE_MUTED);
|
|
|
|
|
2013-01-29 00:30:44 +01:00
|
|
|
FireOnClientMute(target, true);
|
2011-07-07 04:34:21 +02:00
|
|
|
|
|
|
|
if (!silent)
|
|
|
|
{
|
|
|
|
LogAction(client, target, "\"%L\" muted \"%L\"", client, target);
|
|
|
|
}
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
|
2011-07-07 04:34:21 +02:00
|
|
|
PerformUnMute(client, target, bool:silent=false)
|
2008-03-30 09:00:22 +02:00
|
|
|
{
|
|
|
|
g_Muted[target] = false;
|
2014-11-10 01:37:07 +01:00
|
|
|
if (g_Cvar_Deadtalk.IntValue == 1 && !IsPlayerAlive(target))
|
2008-03-30 09:00:22 +02:00
|
|
|
{
|
|
|
|
SetClientListeningFlags(target, VOICE_LISTENALL);
|
|
|
|
}
|
2014-11-10 01:37:07 +01:00
|
|
|
else if (g_Cvar_Deadtalk.IntValue == 2 && !IsPlayerAlive(target))
|
2008-03-30 09:00:22 +02:00
|
|
|
{
|
|
|
|
SetClientListeningFlags(target, VOICE_TEAM);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SetClientListeningFlags(target, VOICE_NORMAL);
|
|
|
|
}
|
|
|
|
|
2013-01-29 00:30:44 +01:00
|
|
|
FireOnClientMute(target, false);
|
2012-09-03 21:45:11 +02:00
|
|
|
|
2011-07-07 04:34:21 +02:00
|
|
|
if (!silent)
|
|
|
|
{
|
|
|
|
LogAction(client, target, "\"%L\" unmuted \"%L\"", client, target);
|
|
|
|
}
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
|
2011-07-07 04:34:21 +02:00
|
|
|
PerformGag(client, target, bool:silent=false)
|
2008-03-30 09:00:22 +02:00
|
|
|
{
|
|
|
|
g_Gagged[target] = true;
|
2013-01-29 00:30:44 +01:00
|
|
|
FireOnClientGag(target, true);
|
2011-07-07 04:34:21 +02:00
|
|
|
|
|
|
|
if (!silent)
|
|
|
|
{
|
|
|
|
LogAction(client, target, "\"%L\" gagged \"%L\"", client, target);
|
|
|
|
}
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
|
2011-07-07 04:34:21 +02:00
|
|
|
PerformUnGag(client, target, bool:silent=false)
|
2008-03-30 09:00:22 +02:00
|
|
|
{
|
|
|
|
g_Gagged[target] = false;
|
2013-01-29 00:30:44 +01:00
|
|
|
FireOnClientGag(target, false);
|
2011-07-07 04:34:21 +02:00
|
|
|
|
|
|
|
if (!silent)
|
|
|
|
{
|
|
|
|
LogAction(client, target, "\"%L\" ungagged \"%L\"", client, target);
|
|
|
|
}
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
PerformSilence(client, target)
|
|
|
|
{
|
|
|
|
if (!g_Gagged[target])
|
|
|
|
{
|
|
|
|
g_Gagged[target] = true;
|
2013-01-29 00:30:44 +01:00
|
|
|
FireOnClientGag(target, true);
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!g_Muted[target])
|
|
|
|
{
|
|
|
|
g_Muted[target] = true;
|
|
|
|
SetClientListeningFlags(target, VOICE_MUTED);
|
2013-01-29 00:30:44 +01:00
|
|
|
FireOnClientMute(target, true);
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
LogAction(client, target, "\"%L\" silenced \"%L\"", client, target);
|
|
|
|
}
|
|
|
|
|
|
|
|
PerformUnSilence(client, target)
|
|
|
|
{
|
|
|
|
if (g_Gagged[target])
|
|
|
|
{
|
|
|
|
g_Gagged[target] = false;
|
2013-01-29 00:30:44 +01:00
|
|
|
FireOnClientGag(target, false);
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (g_Muted[target])
|
|
|
|
{
|
|
|
|
g_Muted[target] = false;
|
|
|
|
|
2014-11-10 01:37:07 +01:00
|
|
|
if (g_Cvar_Deadtalk.IntValue == 1 && !IsPlayerAlive(target))
|
2008-03-30 09:00:22 +02:00
|
|
|
{
|
|
|
|
SetClientListeningFlags(target, VOICE_LISTENALL);
|
|
|
|
}
|
2014-11-10 01:37:07 +01:00
|
|
|
else if (g_Cvar_Deadtalk.IntValue == 2 && !IsPlayerAlive(target))
|
2008-03-30 09:00:22 +02:00
|
|
|
{
|
|
|
|
SetClientListeningFlags(target, VOICE_TEAM);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
SetClientListeningFlags(target, VOICE_NORMAL);
|
2012-09-03 21:45:11 +02:00
|
|
|
}
|
2013-01-29 00:30:44 +01:00
|
|
|
FireOnClientMute(target, false);
|
2008-03-30 09:00:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
LogAction(client, target, "\"%L\" unsilenced \"%L\"", client, target);
|
|
|
|
}
|
|
|
|
|
|
|
|
public Action:Command_Mute(client, args)
|
|
|
|
{
|
|
|
|
if (args < 1)
|
|
|
|
{
|
|
|
|
ReplyToCommand(client, "[SM] Usage: sm_mute <player>");
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
decl String:arg[64];
|
|
|
|
GetCmdArg(1, arg, sizeof(arg));
|
|
|
|
|
|
|
|
decl String:target_name[MAX_TARGET_LENGTH];
|
|
|
|
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
|
|
|
|
|
|
|
|
if ((target_count = ProcessTargetString(
|
|
|
|
arg,
|
|
|
|
client,
|
|
|
|
target_list,
|
|
|
|
MAXPLAYERS,
|
|
|
|
0,
|
|
|
|
target_name,
|
|
|
|
sizeof(target_name),
|
|
|
|
tn_is_ml)) <= 0)
|
|
|
|
{
|
|
|
|
ReplyToTargetError(client, target_count);
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (new i = 0; i < target_count; i++)
|
|
|
|
{
|
|
|
|
new target = target_list[i];
|
|
|
|
|
|
|
|
PerformMute(client, target);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tn_is_ml)
|
|
|
|
{
|
|
|
|
ShowActivity2(client, "[SM] ", "%t", "Muted target", target_name);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ShowActivity2(client, "[SM] ", "%t", "Muted target", "_s", target_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Action:Command_Gag(client, args)
|
|
|
|
{
|
|
|
|
if (args < 1)
|
|
|
|
{
|
|
|
|
ReplyToCommand(client, "[SM] Usage: sm_gag <player>");
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
decl String:arg[64];
|
|
|
|
GetCmdArg(1, arg, sizeof(arg));
|
|
|
|
|
|
|
|
decl String:target_name[MAX_TARGET_LENGTH];
|
|
|
|
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
|
|
|
|
|
|
|
|
if ((target_count = ProcessTargetString(
|
|
|
|
arg,
|
|
|
|
client,
|
|
|
|
target_list,
|
|
|
|
MAXPLAYERS,
|
|
|
|
0,
|
|
|
|
target_name,
|
|
|
|
sizeof(target_name),
|
|
|
|
tn_is_ml)) <= 0)
|
|
|
|
{
|
|
|
|
ReplyToTargetError(client, target_count);
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (new i = 0; i < target_count; i++)
|
|
|
|
{
|
|
|
|
new target = target_list[i];
|
|
|
|
|
|
|
|
PerformGag(client, target);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tn_is_ml)
|
|
|
|
{
|
|
|
|
ShowActivity2(client, "[SM] ", "%t", "Gagged target", target_name);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ShowActivity2(client, "[SM] ", "%t", "Gagged target", "_s", target_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Action:Command_Silence(client, args)
|
|
|
|
{
|
|
|
|
if (args < 1)
|
|
|
|
{
|
|
|
|
ReplyToCommand(client, "[SM] Usage: sm_silence <player>");
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
decl String:arg[64];
|
|
|
|
GetCmdArg(1, arg, sizeof(arg));
|
|
|
|
|
|
|
|
decl String:target_name[MAX_TARGET_LENGTH];
|
|
|
|
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
|
|
|
|
|
|
|
|
if ((target_count = ProcessTargetString(
|
|
|
|
arg,
|
|
|
|
client,
|
|
|
|
target_list,
|
|
|
|
MAXPLAYERS,
|
|
|
|
0,
|
|
|
|
target_name,
|
|
|
|
sizeof(target_name),
|
|
|
|
tn_is_ml)) <= 0)
|
|
|
|
{
|
|
|
|
ReplyToTargetError(client, target_count);
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (new i = 0; i < target_count; i++)
|
|
|
|
{
|
|
|
|
new target = target_list[i];
|
|
|
|
|
|
|
|
PerformSilence(client, target);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tn_is_ml)
|
|
|
|
{
|
|
|
|
ShowActivity2(client, "[SM] ", "%t", "Silenced target", target_name);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ShowActivity2(client, "[SM] ", "%t", "Silenced target", "_s", target_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Action:Command_Unmute(client, args)
|
|
|
|
{
|
|
|
|
if (args < 1)
|
|
|
|
{
|
|
|
|
ReplyToCommand(client, "[SM] Usage: sm_unmute <player>");
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
decl String:arg[64];
|
|
|
|
GetCmdArg(1, arg, sizeof(arg));
|
|
|
|
|
|
|
|
decl String:target_name[MAX_TARGET_LENGTH];
|
|
|
|
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
|
|
|
|
|
|
|
|
if ((target_count = ProcessTargetString(
|
|
|
|
arg,
|
|
|
|
client,
|
|
|
|
target_list,
|
|
|
|
MAXPLAYERS,
|
|
|
|
0,
|
|
|
|
target_name,
|
|
|
|
sizeof(target_name),
|
|
|
|
tn_is_ml)) <= 0)
|
|
|
|
{
|
|
|
|
ReplyToTargetError(client, target_count);
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (new i = 0; i < target_count; i++)
|
|
|
|
{
|
|
|
|
new target = target_list[i];
|
|
|
|
|
|
|
|
if (!g_Muted[target])
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
PerformUnMute(client, target);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tn_is_ml)
|
|
|
|
{
|
|
|
|
ShowActivity2(client, "[SM] ", "%t", "Unmuted target", target_name);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ShowActivity2(client, "[SM] ", "%t", "Unmuted target", "_s", target_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Action:Command_Ungag(client, args)
|
|
|
|
{
|
|
|
|
if (args < 1)
|
|
|
|
{
|
|
|
|
ReplyToCommand(client, "[SM] Usage: sm_ungag <player>");
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
decl String:arg[64];
|
|
|
|
GetCmdArg(1, arg, sizeof(arg));
|
|
|
|
|
|
|
|
decl String:target_name[MAX_TARGET_LENGTH];
|
|
|
|
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
|
|
|
|
|
|
|
|
if ((target_count = ProcessTargetString(
|
|
|
|
arg,
|
|
|
|
client,
|
|
|
|
target_list,
|
|
|
|
MAXPLAYERS,
|
|
|
|
0,
|
|
|
|
target_name,
|
|
|
|
sizeof(target_name),
|
|
|
|
tn_is_ml)) <= 0)
|
|
|
|
{
|
|
|
|
ReplyToTargetError(client, target_count);
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (new i = 0; i < target_count; i++)
|
|
|
|
{
|
|
|
|
new target = target_list[i];
|
|
|
|
|
|
|
|
PerformUnGag(client, target);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tn_is_ml)
|
|
|
|
{
|
|
|
|
ShowActivity2(client, "[SM] ", "%t", "Ungagged target", target_name);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ShowActivity2(client, "[SM] ", "%t", "Ungagged target", "_s", target_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
public Action:Command_Unsilence(client, args)
|
|
|
|
{
|
|
|
|
if (args < 1)
|
|
|
|
{
|
|
|
|
ReplyToCommand(client, "[SM] Usage: sm_unsilence <player>");
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
decl String:arg[64];
|
|
|
|
GetCmdArg(1, arg, sizeof(arg));
|
|
|
|
|
|
|
|
decl String:target_name[MAX_TARGET_LENGTH];
|
|
|
|
decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
|
|
|
|
|
|
|
|
if ((target_count = ProcessTargetString(
|
|
|
|
arg,
|
|
|
|
client,
|
|
|
|
target_list,
|
|
|
|
MAXPLAYERS,
|
|
|
|
0,
|
|
|
|
target_name,
|
|
|
|
sizeof(target_name),
|
|
|
|
tn_is_ml)) <= 0)
|
|
|
|
{
|
|
|
|
ReplyToTargetError(client, target_count);
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (new i = 0; i < target_count; i++)
|
|
|
|
{
|
|
|
|
new target = target_list[i];
|
|
|
|
|
|
|
|
PerformUnSilence(client, target);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tn_is_ml)
|
|
|
|
{
|
|
|
|
ShowActivity2(client, "[SM] ", "%t", "Unsilenced target", target_name);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ShowActivity2(client, "[SM] ", "%t", "Unsilenced target", "_s", target_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
return Plugin_Handled;
|
|
|
|
}
|