3 * =============================================================================
4 * SourceMod SlapSlay Commands Plugin
5 * Implements slap and slay commands
7 * SourceMod (C)2004-2007 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>.
41 public Plugin:myinfo =
43 name = "SlapSlay Commands",
44 author = "AlliedModders LLC",
45 description = "Slap and Slay Commands",
46 version = SOURCEMOD_VERSION,
47 url = "http://www.sourcemod.net/"
50 new Handle:hTopMenu = INVALID_HANDLE;
52 #include "playercommands/slay.sp"
53 #include "playercommands/slap.sp"
55 public OnPluginStart()
57 LoadTranslations("common.phrases");
58 LoadTranslations("slapslay.phrases");
60 RegAdminCmd("sm_slap", Command_Slap, ADMFLAG_SLAY, "sm_slap <#userid|name> [damage]");
61 RegAdminCmd("sm_slay", Command_Slay, ADMFLAG_SLAY, "sm_slay <#userid|name>");
63 /* Account for late loading */
65 if (LibraryExists("adminmenu") && ((topmenu = GetAdminTopMenu()) != INVALID_HANDLE))
67 OnAdminMenuReady(topmenu);
71 public OnAdminMenuReady(Handle:topmenu)
73 /* Block us from being called twice */
74 if (topmenu == hTopMenu)
82 /* Find the "Player Commands" category */
83 new TopMenuObject:player_commands = FindTopMenuCategory(hTopMenu, ADMINMENU_PLAYERCOMMANDS);
85 if (player_commands != INVALID_TOPMENUOBJECT)
87 AddToTopMenu(hTopMenu,
95 AddToTopMenu(hTopMenu,