- added AddTargetsToMenu2() for using COMMAND_FILTER flags

- fixed amb1350 - sm_voteban/menu ban on fake clients would crash
- fake clients can no longer be banned and do not appear on ban menus

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401838
This commit is contained in:
David Anderson
2008-01-04 16:05:26 +00:00
parent 89ac3a14ba
commit 4e07200cfb
6 changed files with 83 additions and 21 deletions
+18 -1
View File
@@ -94,7 +94,23 @@ native Handle:GetAdminTopMenu();
* @param alive_only True to only select alive players.
* @return Number of clients added.
*/
native AddTargetsToMenu(Handle:menu, source_client, bool:in_game_only=true, bool:alive_only=false);
native AddTargetsToMenu(Handle:menu,
source_client,
bool:in_game_only=true,
bool:alive_only=false);
/**
* Adds targets to an admin menu.
*
* Each client is displayed as: name (userid)
* Each item contains the userid as a string for its info.
*
* @param menu Menu Handle.
* @param source_client Source client, or 0 to ignore immunity.
* @param flags COMMAND_FILTER flags from commandfilters.inc.
* @return Number of clients added.
*/
native AddTargetsToMenu2(Handle:menu, source_client, flags);
/**
* Re-displays the admin menu to a client after selecting an item.
@@ -132,5 +148,6 @@ public __pl_adminmenu_SetNTVOptional()
{
MarkNativeAsOptional("GetAdminTopMenu");
MarkNativeAsOptional("AddTargetsToMenu");
MarkNativeAsOptional("AddTargetsToMenu2");
}
#endif
+14 -14
View File
@@ -37,21 +37,21 @@
#define MAX_TARGET_LENGTH 64
#define COMMAND_FILTER_ALIVE (1<<0) /* Only allow alive players */
#define COMMAND_FILTER_DEAD (1<<1) /* Only filter dead players */
#define COMMAND_FILTER_CONNECTED (1<<2) /* Allow players not fully in-game */
#define COMMAND_FILTER_NO_IMMUNITY (1<<3) /* Ignore immunity rules */
#define COMMAND_FILTER_NO_MULTI (1<<4) /* Do not allow multiple target patterns */
#define COMMAND_FILTER_NO_BOTS (1<<5) /* Do not allow bots to be targetted */
#define COMMAND_FILTER_ALIVE (1<<0) /**< Only allow alive players */
#define COMMAND_FILTER_DEAD (1<<1) /**< Only filter dead players */
#define COMMAND_FILTER_CONNECTED (1<<2) /**< Allow players not fully in-game */
#define COMMAND_FILTER_NO_IMMUNITY (1<<3) /**< Ignore immunity rules */
#define COMMAND_FILTER_NO_MULTI (1<<4) /**< Do not allow multiple target patterns */
#define COMMAND_FILTER_NO_BOTS (1<<5) /**< Do not allow bots to be targetted */
#define COMMAND_TARGET_NONE 0 /* No target was found */
#define COMMAND_TARGET_NOT_ALIVE -1 /* Single client is not alive */
#define COMMAND_TARGET_NOT_DEAD -2 /* Single client is not dead */
#define COMMAND_TARGET_NOT_IN_GAME -3 /* Single client is not in game */
#define COMMAND_TARGET_IMMUNE -4 /* Single client is immune */
#define COMMAND_TARGET_EMPTY_FILTER -5 /* A multi-filter (such as @all) had no targets */
#define COMMAND_TARGET_NOT_HUMAN -6 /* Target was not human */
#define COMMAND_TARGET_AMBIGUOUS -7 /* Partial name had too many targets */
#define COMMAND_TARGET_NONE 0 /**< No target was found */
#define COMMAND_TARGET_NOT_ALIVE -1 /**< Single client is not alive */
#define COMMAND_TARGET_NOT_DEAD -2 /**< Single client is not dead */
#define COMMAND_TARGET_NOT_IN_GAME -3 /**< Single client is not in game */
#define COMMAND_TARGET_IMMUNE -4 /**< Single client is immune */
#define COMMAND_TARGET_EMPTY_FILTER -5 /**< A multi-filter (such as @all) had no targets */
#define COMMAND_TARGET_NOT_HUMAN -6 /**< Target was not human */
#define COMMAND_TARGET_AMBIGUOUS -7 /**< Partial name had too many targets */
/**
* Processes a generic command target string, and resolves it to a list