1.1 --- a/plugins/include/menus.inc Mon May 25 18:12:26 2009 -0700
1.2 +++ b/plugins/include/menus.inc Sat May 30 19:59:55 2009 -0400
1.3 @@ -94,6 +94,8 @@
1.4 #define VOTEINFO_ITEM_INDEX 0 /**< Item index */
1.5 #define VOTEINFO_ITEM_VOTES 1 /**< Number of votes for the item */
1.6
1.7 +#define VOTEFLAG_NO_REVOTES (1<<0) /**< Players cannot change their votes */
1.8 +
1.9 /**
1.10 * Reasons a menu can be cancelled (MenuAction_Cancel).
1.11 */
1.12 @@ -469,22 +471,24 @@
1.13 * @param clients Array of clients to broadcast to.
1.14 * @param numClients Number of clients in the array.
1.15 * @param time Maximum time to leave menu on the screen.
1.16 + * @param flags Optional voting flags.
1.17 * @return True on success, false if this menu already has a vote session
1.18 * in progress.
1.19 * @error Invalid Handle, or a vote is already in progress.
1.20 */
1.21 -native bool:VoteMenu(Handle:menu, clients[], numClients, time);
1.22 +native bool:VoteMenu(Handle:menu, clients[], numClients, time, flags=0);
1.23
1.24 /**
1.25 * Sends a vote menu to all clients. See VoteMenu() for more information.
1.26 *
1.27 * @param menu Menu Handle.
1.28 * @param time Maximum time to leave menu on the screen.
1.29 + * @param flags Optional voting flags.
1.30 * @return True on success, false if this menu already has a vote session
1.31 * in progress.
1.32 * @error Invalid Handle.
1.33 */
1.34 -stock VoteMenuToAll(Handle:menu, time)
1.35 +stock VoteMenuToAll(Handle:menu, time, flags=0)
1.36 {
1.37 new num = GetMaxClients();
1.38 new total;
1.39 @@ -499,7 +503,7 @@
1.40 players[total++] = i;
1.41 }
1.42
1.43 - return VoteMenu(menu, players, total, time);
1.44 + return VoteMenu(menu, players, total, time, flags);
1.45 }
1.46 /**
1.47 * Callback for when a vote has ended and results are available.
1.48 @@ -543,7 +547,7 @@
1.49 /**
1.50 * Returns whether a client is in the pool of clients allowed
1.51 * to participate in the current vote. This is determined by
1.52 - * the client list passed to StartVote().
1.53 + * the client list passed to VoteMenu().
1.54 *
1.55 * @param client Client index.
1.56 * @return True if client is allowed to vote, false otherwise.
1.57 @@ -555,12 +559,13 @@
1.58 * Redraws the current vote menu to a client in the voting pool.
1.59 *
1.60 * @param client Client index.
1.61 + * @param revotes True to allow revotes, false otherwise.
1.62 * @return True on success, false if the client is in the vote pool
1.63 * but cannot vote again.
1.64 * @error No vote in progress, client is not in the voting pool,
1.65 * or client index is invalid.
1.66 */
1.67 -native bool:RedrawClientVoteMenu(client);
1.68 +native bool:RedrawClientVoteMenu(client, bool:revotes=true);
1.69
1.70 /**
1.71 * Returns a style's global Handle.
1.72 @@ -807,3 +812,4 @@
1.73
1.74 return true;
1.75 }
1.76 +