Updated some CS:GO gamedata.
3 * =============================================================================
4 * SourceMod Basefuncommands Plugin
5 * Provides slay functionality
7 * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
8 * =============================================================================
10 * This program is free software; you can redistribute it and/or modify it under
11 * the terms of the GNU General Public License, version 3.0, as published by the
12 * Free Software Foundation.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19 * You should have received a copy of the GNU General Public License along with
20 * this program. If not, see <http://www.gnu.org/licenses/>.
22 * As a special exception, AlliedModders LLC gives you permission to link the
23 * code of this program (as well as its derivative works) to "Half-Life 2," the
24 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
25 * by the Valve Corporation. You must obey the GNU General Public License in
26 * all respects for all other code used. Additionally, AlliedModders LLC grants
27 * this exception to all derivative works. AlliedModders LLC defines further
28 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
29 * or <http://www.sourcemod.net/license.php>.
34 PerformSlay(client, target)
36 LogAction(client, target, "\"%L\" slayed \"%L\"", client, target);
37 ForcePlayerSuicide(target);
40 DisplaySlayMenu(client)
42 new Handle:menu = CreateMenu(MenuHandler_Slay);
44 decl String:title[100];
45 Format(title, sizeof(title), "%T:", "Slay player", client);
46 SetMenuTitle(menu, title);
47 SetMenuExitBackButton(menu, true);
49 AddTargetsToMenu(menu, client, true, true);
51 DisplayMenu(menu, client, MENU_TIME_FOREVER);
54 public AdminMenu_Slay(Handle:topmenu,
56 TopMenuObject:object_id,
61 if (action == TopMenuAction_DisplayOption)
63 Format(buffer, maxlength, "%T", "Slay player", param);
65 else if (action == TopMenuAction_SelectOption)
67 DisplaySlayMenu(param);
71 public MenuHandler_Slay(Handle:menu, MenuAction:action, param1, param2)
73 if (action == MenuAction_End)
77 else if (action == MenuAction_Cancel)
79 if (param2 == MenuCancel_ExitBack && hTopMenu != INVALID_HANDLE)
81 DisplayTopMenu(hTopMenu, param1, TopMenuPosition_LastCategory);
84 else if (action == MenuAction_Select)
89 GetMenuItem(menu, param2, info, sizeof(info));
90 userid = StringToInt(info);
92 if ((target = GetClientOfUserId(userid)) == 0)
94 PrintToChat(param1, "[SM] %t", "Player no longer available");
96 else if (!CanUserTarget(param1, target))
98 PrintToChat(param1, "[SM] %t", "Unable to target");
100 else if (!IsPlayerAlive(target))
102 ReplyToCommand(param1, "[SM] %t", "Player has since died");
106 decl String:name[32];
107 GetClientName(target, name, sizeof(name));
108 PerformSlay(param1, target);
109 ShowActivity2(param1, "[SM] ", "%t", "Slayed target", "_s", name);
112 DisplaySlayMenu(param1);
116 public Action:Command_Slay(client, args)
120 ReplyToCommand(client, "[SM] Usage: sm_slay <#userid|name>");
121 return Plugin_Handled;
125 GetCmdArg(1, arg, sizeof(arg));
127 decl String:target_name[MAX_TARGET_LENGTH];
128 decl target_list[MAXPLAYERS], target_count, bool:tn_is_ml;
130 if ((target_count = ProcessTargetString(
135 COMMAND_FILTER_ALIVE,
140 ReplyToTargetError(client, target_count);
141 return Plugin_Handled;
144 for (new i = 0; i < target_count; i++)
146 PerformSlay(client, target_list[i]);
151 ShowActivity2(client, "[SM] ", "%t", "Slayed target", target_name);
155 ShowActivity2(client, "[SM] ", "%t", "Slayed target", "_s", target_name);
158 return Plugin_Handled;