plugins/include/adminmenu.inc
author Borja Ferrer <faluco@alliedmods.net>
Mon Oct 01 21:20:30 2007 +0000 (2007-10-01)
changeset 1515 3e112467aacd
parent 1513 cb717592c911
child 1518 5c2bbd2506fc
permissions -rw-r--r--
fixed amb991, dispatchkeyvalue natives had wrong offsets
     1 /**
     2  * vim: set ts=4 :
     3  * =============================================================================
     4  * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
     5  * =============================================================================
     6  *
     7  * This file is part of the SourceMod/SourcePawn SDK.
     8  *
     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.
    12  * 
    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
    16  * details.
    17  *
    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/>.
    20  *
    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>.
    29  *
    30  * Version: $Id$
    31  */
    32  
    33 #if defined _adminmenu_included
    34  #endinput
    35 #endif
    36 #define _adminmenu_included
    37 
    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
    43 #endif
    44 
    45 #include <topmenus>
    46 
    47 /* Restore old REQUIRE_EXTENSIONS value if necessary */
    48 #if defined TEMP_REQUIRE_EXTENSIONS
    49  #define REQUIRE_EXTENSIONS
    50  #undef TEMP_REQUIRE_EXTENSIONS
    51 #endif
    52 
    53 /** Category for player commands. */
    54 #define ADMINMENU_PLAYERCOMMANDS		"PlayerCommands"
    55 
    56 /**
    57  * Called when the admin menu is created and 3rd party plugins can grab 
    58  * the Handle or add categories.
    59  * 
    60  * @param topmenu		Handle to the admin menu's TopMenu.
    61  * @noreturn
    62  */
    63 forward OnAdminMenuCreated(Handle:topmenu);
    64 
    65 /**
    66  * Called when the admin menu is ready to have items added.
    67  * 
    68  * @param topmenu		Handle to the admin menu's TopMenu.
    69  * @noreturn
    70  */
    71 forward OnAdminMenuReady(Handle:topmenu);
    72 
    73 /**
    74  * Retrieves the Handle to the admin top menu.
    75  *
    76  * @return				Handle to the admin menu's TopMenu,
    77  *						or INVALID_HANDLE if not created yet.
    78  */
    79 native Handle:GetAdminTopMenu();
    80 
    81 /**
    82  * Adds targets to an admin menu.
    83  *
    84  * Each client is displayed as: name (userid)
    85  * Each item contains the userid as a string for its info.
    86  *
    87  * @param menu			Menu Handle.
    88  * @param source_client	Source client, or 0 to ignore immunity.
    89  * @param in_game_only	True to only select in-game players.
    90  * @return				Number of clients added.
    91  */
    92 native AddTargetsToMenu(Handle:menu, source_client, bool:in_game_only=true);
    93 
    94 /* DO NOT EDIT BELOW THIS LINE */
    95 
    96 public SharedPlugin:__pl_adminmenu = 
    97 {
    98 	name = "adminmenu",
    99 	file = "adminmenu.smx",
   100 #if defined REQUIRE_PLUGIN
   101 	required = 1,
   102 #else
   103 	required = 0,
   104 #endif
   105 };
   106 
   107 public __pl_adminmenu_SetNTVOptional()
   108 {
   109 	MarkNativeAsOptional("GetAdminTopMenu");
   110 	MarkNativeAsOptional("AddTargetsToMenu");
   111 }
   112