Initial Import of beta structs extension.
3 * =============================================================================
4 * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
5 * =============================================================================
7 * This file is part of the SourceMod/SourcePawn SDK.
9 * This program is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU General Public License, version 3.0, as published by the
11 * Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 * You should have received a copy of the GNU General Public License along with
19 * this program. If not, see <http://www.gnu.org/licenses/>.
21 * As a special exception, AlliedModders LLC gives you permission to link the
22 * code of this program (as well as its derivative works) to "Half-Life 2," the
23 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
24 * by the Valve Corporation. You must obey the GNU General Public License in
25 * all respects for all other code used. Additionally, AlliedModders LLC grants
26 * this exception to all derivative works. AlliedModders LLC defines further
27 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
28 * or <http://www.sourcemod.net/license.php>.
33 #if defined _adminmenu_included
36 #define _adminmenu_included
38 /* Decide whether topmenus should be required */
39 #if !defined REQUIRE_PLUGIN
40 #if defined REQUIRE_EXTENSIONS
41 #define TEMP_REQUIRE_EXTENSIONS
42 #undef REQUIRE_EXTENSIONS
47 /* Restore old REQUIRE_EXTENSIONS value if necessary */
48 #if defined TEMP_REQUIRE_EXTENSIONS
49 #define REQUIRE_EXTENSIONS
50 #undef TEMP_REQUIRE_EXTENSIONS
53 /** Category for player commands. */
54 #define ADMINMENU_PLAYERCOMMANDS "PlayerCommands"
55 /** Category for server commands. */
56 #define ADMINMENU_SERVERCOMMANDS "ServerCommands"
57 /** Category for voting commands. */
58 #define ADMINMENU_VOTINGCOMMANDS "VotingCommands"
61 * Called when the admin menu is created and 3rd party plugins can grab
62 * the Handle or add categories.
64 * @param topmenu Handle to the admin menu's TopMenu.
67 forward OnAdminMenuCreated(Handle:topmenu);
70 * Called when the admin menu is ready to have items added.
72 * @param topmenu Handle to the admin menu's TopMenu.
75 forward OnAdminMenuReady(Handle:topmenu);
78 * Retrieves the Handle to the admin top menu.
80 * @return Handle to the admin menu's TopMenu,
81 * or INVALID_HANDLE if not created yet.
83 native Handle:GetAdminTopMenu();
86 * Adds targets to an admin menu.
88 * Each client is displayed as: name (userid)
89 * Each item contains the userid as a string for its info.
91 * @param menu Menu Handle.
92 * @param source_client Source client, or 0 to ignore immunity.
93 * @param in_game_only True to only select in-game players.
94 * @param alive_only True to only select alive players.
95 * @return Number of clients added.
97 native AddTargetsToMenu(Handle:menu,
99 bool:in_game_only=true,
100 bool:alive_only=false);
103 * Adds targets to an admin menu.
105 * Each client is displayed as: name (userid)
106 * Each item contains the userid as a string for its info.
108 * @param menu Menu Handle.
109 * @param source_client Source client, or 0 to ignore immunity.
110 * @param flags COMMAND_FILTER flags from commandfilters.inc.
111 * @return Number of clients added.
113 native AddTargetsToMenu2(Handle:menu, source_client, flags);
116 * Re-displays the admin menu to a client after selecting an item.
117 * Auto-aborts if the Handle is invalid.
119 * @param topmenu TopMenu Handle.
120 * @param client Client index.
121 * @return True on success, false on failure.
123 stock bool:RedisplayAdminMenu(Handle:topmenu, client)
125 if (topmenu == INVALID_HANDLE)
130 return DisplayTopMenu(topmenu, client, TopMenuPosition_LastCategory);
133 /* DO NOT EDIT BELOW THIS LINE */
135 public SharedPlugin:__pl_adminmenu =
138 file = "adminmenu.smx",
139 #if defined REQUIRE_PLUGIN
146 #if !defined REQUIRE_PLUGIN
147 public __pl_adminmenu_SetNTVOptional()
149 MarkNativeAsOptional("GetAdminTopMenu");
150 MarkNativeAsOptional("AddTargetsToMenu");
151 MarkNativeAsOptional("AddTargetsToMenu2");