New stock to get m_fFlags, and #defines for its bits.
3 * =============================================================================
4 * SourceMod (C)2004-2007 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 _menus_included
36 #define _menus_included
39 * Low-level drawing style of the menu.
43 MenuStyle_Default = 0, /**< The "default" menu style for the mod */
44 MenuStyle_Valve = 1, /**< The Valve provided menu style (Used on HL2DM) */
45 MenuStyle_Radio = 2, /**< The simpler menu style commonly used on CS:S */
49 * Different actions for the menu "pump" callback
53 MenuAction_Start = (1<<0), /**< A menu has been started (nothing passed) */
54 MenuAction_Display = (1<<1), /**< A menu is about to be displayed (param1=client, param2=MenuPanel Handle) */
55 MenuAction_Select = (1<<2), /**< An item was selected (param1=client, param2=item) */
56 MenuAction_Cancel = (1<<3), /**< The menu was cancelled (param1=client, param2=reason) */
57 MenuAction_End = (1<<4), /**< A menu display has fully ended.
58 param1 is the MenuEnd reason, and if it's MenuEnd_Cancelled, then
59 param2 is the MenuCancel reason from MenuAction_Cancel.
61 MenuAction_VoteEnd = (1<<5), /**< (VOTE ONLY): A vote sequence has succeeded (param1=chosen item)
62 This is not called if SetVoteResultCallback has been used on the menu. */
63 MenuAction_VoteStart = (1<<6), /**< (VOTE ONLY): A vote sequence has started (nothing passed) */
64 MenuAction_VoteCancel = (1<<7), /**< (VOTE ONLY): A vote sequence has been cancelled (param1=reason) */
65 MenuAction_DrawItem = (1<<8), /**< An item is being drawn; return the new style (param1=client, param2=item) */
66 MenuAction_DisplayItem = (1<<9),/**< Item text is being drawn to the display (param1=client, param2=item)
67 To change the text, use RedrawMenuItem().
68 If you do so, return its return value. Otherwise, return 0.
72 /** Default menu actions */
73 #define MENU_ACTIONS_DEFAULT MenuAction_Select|MenuAction_Cancel|MenuAction_End
74 /** All menu actions */
75 #define MENU_ACTIONS_ALL MenuAction:0xFFFFFFFF
77 #define MENU_NO_PAGINATION 0 /**< Menu should not be paginated (10 items max) */
78 #define MENU_TIME_FOREVER 0 /**< Menu should be displayed as long as possible */
80 #define ITEMDRAW_DEFAULT (0) /**< Item should be drawn normally */
81 #define ITEMDRAW_DISABLED (1<<0) /**< Item is drawn but not selectable */
82 #define ITEMDRAW_RAWLINE (1<<1) /**< Item should be a raw line, without a slot */
83 #define ITEMDRAW_NOTEXT (1<<2) /**< No text should be drawn */
84 #define ITEMDRAW_SPACER (1<<3) /**< Item should be drawn as a spacer, if possible */
85 #define ITEMDRAW_IGNORE ((1<<1)|(1<<2)) /**< Item should be completely ignored (rawline + notext) */
86 #define ITEMDRAW_CONTROL (1<<4) /**< Item is control text (back/next/exit) */
88 #define MENUFLAG_BUTTON_EXIT (1<<0) /**< Menu has an "exit" button (default if paginated) */
89 #define MENUFLAG_BUTTON_EXITBACK (1<<1) /**< Menu has an "exit back" button */
90 #define MENUFLAG_NO_SOUND (1<<2) /**< Menu will not have any select sounds */
92 #define VOTEINFO_CLIENT_INDEX 0 /**< Client index */
93 #define VOTEINFO_CLIENT_ITEM 1 /**< Item the client selected, or -1 for none */
94 #define VOTEINFO_ITEM_INDEX 0 /**< Item index */
95 #define VOTEINFO_ITEM_VOTES 1 /**< Number of votes for the item */
98 * Reasons a menu can be cancelled (MenuAction_Cancel).
102 MenuCancel_Disconnected = -1, /**< Client dropped from the server */
103 MenuCancel_Interrupted = -2, /**< Client was interrupted with another menu */
104 MenuCancel_Exit = -3, /**< Client exited via "exit" */
105 MenuCancel_NoDisplay = -4, /**< Menu could not be displayed to the client */
106 MenuCancel_Timeout = -5, /**< Menu timed out */
107 MenuCancel_ExitBack = -6, /**< Client selected "exit back" on a paginated menu */
111 * Reasons a vote can be cancelled (MenuAction_VoteCancel).
115 VoteCancel_Generic = -1, /**< Vote was generically cancelled. */
116 VoteCancel_NoVotes = -2, /**< Vote did not receive any votes. */
120 * Reasons a menu ended (MenuAction_End).
124 MenuEnd_Selected = 0, /**< Menu item was selected */
125 MenuEnd_VotingDone = -1, /**< Voting finished */
126 MenuEnd_VotingCancelled = -2, /**< Voting was cancelled */
127 MenuEnd_Cancelled = -3, /**< Menu was cancelled (reason in param2) */
128 MenuEnd_Exit = -4, /**< Menu was cleanly exited via "exit" */
129 MenuEnd_ExitBack = -5, /**< Menu was cleanly exited via "back" */
133 * Describes a menu's source
137 MenuSource_None = 0, /**< No menu is being displayed */
138 MenuSource_External = 1, /**< External menu */
139 MenuSource_Normal = 2, /**< A basic menu is being displayed */
140 MenuSource_RawPanel = 3, /**< A display is active, but it is not tied to a menu */
144 * Called when a menu action is completed.
146 * @param menu The menu being acted upon.
147 * @param action The action of the menu.
148 * @param param1 First action parameter (usually the client).
149 * @param param2 Second action parameter (usually the item).
152 functag MenuHandler public(Handle:menu, MenuAction:action, param1, param2);
155 * Creates a new, empty menu using the default style.
157 * @param handler Function which will receive menu actions.
158 * @param actions Optionally set which actions to receive. Select,
159 * Cancel, and End will always be received regardless
160 * of whether they are set or not. They are also
161 * the only default actions.
162 * @return A new menu Handle.
164 native Handle:CreateMenu(MenuHandler:handler, MenuAction:actions=MENU_ACTIONS_DEFAULT);
167 * Displays a menu to a client.
169 * @param menu Menu Handle.
170 * @param client Client index.
171 * @param time Maximum time to leave menu on the screen.
172 * @return True on success, false on failure.
173 * @error Invalid Handle or client not in game.
175 native bool:DisplayMenu(Handle:menu, client, time);
178 * Displays a menu to a client, starting from the given item.
180 * @param menu Menu Handle.
181 * @param client Client index.
182 * @param first_item First item to begin drawing from.
183 * @param time Maximum time to leave menu on the screen.
184 * @return True on success, false on failure.
185 * @error Invalid Handle or client not in game.
187 native bool:DisplayMenuAtItem(Handle:menu, client, first_item, time);
190 * Appends a new item to the end of a menu.
192 * @param menu Menu Handle.
193 * @param info Item information string.
194 * @param display Default item display string.
195 * @param style Drawing style flags. Anything other than DEFAULT or
196 * DISABLED will be completely ignored when paginating.
197 * @return True on success, false on failure.
198 * @error Invalid Handle or item limit reached.
200 native AddMenuItem(Handle:menu,
202 const String:display[],
203 style=ITEMDRAW_DEFAULT);
206 * Inserts an item into the menu before a certain position; the new item will
207 * be at the given position and all next items pushed forward.
209 * @param menu Menu Handle.
210 * @param position Position, starting from 0.
211 * @param info Item information string.
212 * @param display Default item display string.
213 * @param style Drawing style flags. Anything other than DEFAULT or
214 * DISABLED will be completely ignored when paginating.
215 * @return True on success, false on failure.
216 * @error Invalid Handle or menu position.
218 native bool:InsertMenuItem(Handle:menu,
221 const String:display[],
222 style=ITEMDRAW_DEFAULT);
225 * Removes an item from the menu.
227 * @param menu Menu Handle.
228 * @param position Position, starting from 0.
229 * @return True on success, false on failure.
230 * @error Invalid Handle or menu position.
232 native bool:RemoveMenuItem(Handle:menu, position);
235 * Removes all items from a menu.
237 * @param menu Menu Handle.
239 * @error Invalid Handle or menu position.
241 native RemoveAllMenuItems(Handle:menu);
244 * Retrieves information about a menu item.
246 * @param menu Menu Handle.
247 * @param position Position, starting from 0.
248 * @param infoBuf Info buffer.
249 * @param infoBufLen Maximum length of the info buffer.
250 * @param style By-reference variable to store drawing flags.
251 * @param dispBuf Display buffer.
252 * @param dispBufLen Maximum length of the display buffer.
253 * @return True on success, false if position is invalid.
254 * @error Invalid Handle.
256 native bool:GetMenuItem(Handle:menu,
265 * Returns the first item on the page of a currently selected menu.
267 * This is only valid inside a MenuAction_Select callback.
269 * @return First item number on the page the client was viewing
270 * before selecting the item in the callback. This can
271 * be used to re-display the menu from the original
273 * @error Not called from inside a MenuAction_Select callback.
275 native GetMenuSelectionPosition();
278 * Returns the number of items in a menu.
280 * @param menu Menu Handle.
281 * @return Number of items in the menu.
282 * @error Invalid Handle.
284 native GetMenuItemCount(Handle:menu);
287 * Sets whether the menu should be paginated or not.
289 * If itemsPerPage is MENU_NO_PAGINATION, and the exit button flag is set,
290 * then the exit button flag is removed. It can be re-applied if desired.
292 * @param menu Handle to the menu.
293 * @param itemsPerPage Number of items per page, or MENU_NO_PAGINATION.
294 * @return True on success, false if pagination is too high or
296 * @error Invalid Handle.
298 native bool:SetMenuPagination(Handle:menu, itemsPerPage);
301 * Returns a menu's pagination setting.
303 * @param menu Handle to the menu.
304 * @return Pagination setting.
305 * @error Invalid Handle.
307 native GetMenuPagination(Handle:menu);
310 * Returns a menu's MenuStyle Handle. The Handle
311 * is global and cannot be freed.
313 * @param menu Handle to the menu.
314 * @return Handle to the menu's draw style.
315 * @error Invalid Handle.
317 native Handle:GetMenuStyle(Handle:menu);
320 * Sets the menu's default title/instruction message.
322 * @param menu Menu Handle.
323 * @param fmt Message string format
324 * @param ... Message string arguments.
326 * @error Invalid Handle.
328 native SetMenuTitle(Handle:menu, const String:fmt[], any:...);
331 * Returns the text of a menu's title.
333 * @param menu Menu Handle.
334 * @param buffer Buffer to store title.
335 * @param maxlength Maximum length of the buffer.
336 * @return Number of bytes written.
337 * @error Invalid Handle/
339 native GetMenuTitle(Handle:menu, String:buffer[], maxlength);
342 * Creates a raw MenuPanel based off the menu's style.
343 * The Handle must be freed with CloseHandle().
345 * @return A new MenuPanel Handle.
346 * @error Invalid Handle.
348 native Handle:CreatePanelFromMenu(Handle:menu);
351 * Returns whether or not the menu has an exit button.
352 * By default, menus have an exit button.
354 * @param menu Menu Handle.
355 * @return True if the menu has an exit button; false otherwise.
356 * @error Invalid Handle.
358 native bool:GetMenuExitButton(Handle:menu);
361 * Sets whether or not the menu has an exit button. By default, paginated menus
362 * have an exit button.
364 * If a menu's pagination is changed to MENU_NO_PAGINATION, and the pagination
365 * was previously a different value, then the Exit button status is changed to
366 * false. It must be explicitly re-enabled afterwards.
368 * If a non-paginated menu has an exit button, then at most 9 items will be
371 * @param menu Menu Handle.
372 * @param button True to enable the button, false to remove it.
373 * @return True if allowed; false on failure.
374 * @error Invalid Handle.
376 native bool:SetMenuExitButton(Handle:menu, bool:button);
379 * Returns whether or not the menu has an "exit back" button. By default,
380 * menus do not have an exit back button.
382 * Exit Back buttons appear as "Back" on page 1 of paginated menus and have
383 * functionality defined by the user in MenuEnd_ExitBack.
385 * @param menu Menu Handle.
386 * @return True if the menu has an exit back button; false otherwise.
387 * @error Invalid Handle.
389 native bool:GetMenuExitBackButton(Handle:menu);
392 * Sets whether or not the menu has an "exit back" button. By default, menus
393 * do not have an exit back button.
395 * Exit Back buttons appear as "Back" on page 1 of paginated menus and have
396 * functionality defined by the user in MenuEnd_ExitBack.
398 * @param menu Menu Handle.
399 * @param button True to enable the button, false to remove it.
400 * @error Invalid Handle.
402 native SetMenuExitBackButton(Handle:menu, bool:button);
406 * Cancels a menu from displaying on all clients. While the
407 * cancellation is in progress, this menu cannot be re-displayed
410 * The menu may still exist on the client's screen after this command.
411 * This simply verifies that the menu is not being used anywhere.
413 * If any vote is in progress on a menu, it will be cancelled.
415 * @param menu Menu Handle.
417 * @error Invalid Handle.
419 native CancelMenu(Handle:menu);
422 * Retrieves a menu's option flags.
424 * @param menu Menu Handle.
425 * @return A bitstring of MENUFLAG bits.
426 * @error Invalid Handle.
428 native GetMenuOptionFlags(Handle:menu);
431 * Sets a menu's option flags.
433 * If a certain bit is not supported, it will be stripped before being set.
434 * See SetMenuExitButton() for information on Exit buttons.
435 * See SetMenuExitBackButton() for information on Exit Back buttons.
437 * @param menu Menu Handle.
438 * @param flags A new bitstring of MENUFLAG bits.
440 * @error Invalid Handle.
442 native SetMenuOptionFlags(Handle:menu, flags);
445 * Returns whether a vote is in progress.
447 * @param menu Deprecated; no longer used.
448 * @return True if a vote is in progress, false otherwise.
450 native bool:IsVoteInProgress(Handle:menu=INVALID_HANDLE);
453 * Cancels the vote in progress.
456 * @error If no vote is in progress.
461 * Broadcasts a menu to a list of clients. The most selected item will be
462 * returned through MenuAction_End. On a tie, a random item will be returned
463 * from a list of the tied items.
465 * Note that MenuAction_VoteEnd and MenuAction_VoteStart are both
466 * default callbacks and do not need to be enabled.
468 * @param menu Menu Handle.
469 * @param clients Array of clients to broadcast to.
470 * @param numClients Number of clients in the array.
471 * @param time Maximum time to leave menu on the screen.
472 * @return True on success, false if this menu already has a vote session
474 * @error Invalid Handle, or a vote is already in progress.
476 native bool:VoteMenu(Handle:menu, clients[], numClients, time);
479 * Sends a vote menu to all clients. See VoteMenu() for more information.
481 * @param menu Menu Handle.
482 * @param time Maximum time to leave menu on the screen.
483 * @return True on success, false if this menu already has a vote session
485 * @error Invalid Handle.
487 stock VoteMenuToAll(Handle:menu, time)
489 new num = GetMaxClients();
493 for (new i=1; i<=num; i++)
495 if (!IsClientInGame(i))
499 players[total++] = i;
502 return VoteMenu(menu, players, total, time);
505 * Callback for when a vote has ended and results are available.
507 * @param menu The menu being voted on.
508 * @param num_votes Number of votes tallied in total.
509 * @param num_clients Number of clients who could vote.
510 * @param client_info Array of clients. Use VOTEINFO_CLIENT_ defines.
511 * @param num_items Number of unique items that were selected.
512 * @param item_info Array of items, sorted by count. Use VOTEINFO_ITEM
516 functag VoteHandler public(Handle:menu,
519 const client_info[][2],
521 const item_info[][2]);
524 * Sets an advanced vote handling callback. If this callback is set,
525 * MenuAction_VoteEnd will not be called.
527 * @param menu Menu Handle.
528 * @param callback Callback function.
530 * @error Invalid Handle or callback.
532 native SetVoteResultCallback(Handle:menu, VoteHandler:callback);
535 * Returns the number of seconds you should "wait" before displaying
536 * a publicly invocable menu. This number is the time remaining until
537 * (last_vote + sm_vote_delay).
539 * @return Number of seconds to wait, or 0 for none.
541 native CheckVoteDelay();
544 * Returns a style's global Handle.
546 * @param style Menu Style.
547 * @return A Handle, or INVALID_HANDLE if not found or unusable.
549 native Handle:GetMenuStyleHandle(MenuStyle:style);
552 * Creates a MenuPanel from a MenuStyle. Panels are used for drawing raw
553 * menus without any extra helper functions. The Handle must be closed
554 * with CloseHandle().
556 * @param hStyle MenuStyle Handle, or INVALID_HANDLE to use the default style.
557 * @return A new MenuPanel Handle.
558 * @error Invalid Handle other than INVALID_HANDLE.
560 native Handle:CreatePanel(Handle:hStyle=INVALID_HANDLE);
563 * Creates a Menu from a MenuStyle. The Handle must be closed with
566 * @parma hStyle MenuStyle Handle, or INVALID_HANDLE to use the default style.
567 * @param handler Function which will receive menu actions.
568 * @param actions Optionally set which actions to receive. Select,
569 * Cancel, and End will always be received regardless
570 * of whether they are set or not. They are also
571 * the only default actions.
572 * @return A new menu Handle.
573 * @error Invalid Handle other than INVALID_HANDLE.
575 native Handle:CreateMenuEx(Handle:hStyle=INVALID_HANDLE, MenuHandler:handler, MenuAction:actions=MENU_ACTIONS_DEFAULT);
578 * Returns whether a client is viewing a menu.
580 * @param client Client index.
581 * @param hStyle MenuStyle Handle, or INVALID_HANDLE to use the default style.
582 * @return A MenuSource value.
583 * @error Invalid Handle other than INVALID_HANDLE.
585 native MenuSource:GetClientMenu(client, Handle:hStyle=INVALID_HANDLE);
588 * Cancels a menu on a client. This will only affect non-external menus.
590 * @param hstyle MenuStyle Handle, or INVALID_HANDLE to use the default style.
591 * @param client Client index.
592 * @param autoIgnore If true, no menus can be re-drawn on the client during
593 * the cancellation process.
594 * @return True if a menu was cancelled, false otherwise.
596 native bool:CancelClientMenu(client, bool:autoIgnore=false, Handle:hStyle=INVALID_HANDLE);
599 * Returns a style's maximum items per page.
601 * @param hStyle MenuStyle Handle, or INVALID_HANDLE to use the default style.
602 * @return Maximum items per page.
603 * @error Invalid Handle other than INVALID_HANDLE.
605 native GetMaxPageItems(Handle:hStyle=INVALID_HANDLE);
608 * Returns a MenuPanel's parent style.
610 * @param panel A MenuPanel Handle.
611 * @return The MenuStyle Handle that created the panel.
612 * @error Invalid Handle.
614 native Handle:GetPanelStyle(Handle:panel);
617 * Sets the panel's title.
619 * @param panel A MenuPanel Handle.
620 * @param title Text to set as the title.
621 * @param onlyIfEmpty If true, the title will only be set if no title is set.
623 * @error Invalid Handle.
625 native Handle:SetPanelTitle(Handle:panel, const String:text[], bool:onlyIfEmpty=false);
628 * Draws an item on a panel. If the item takes up a slot, the position
631 * @param panel A MenuPanel Handle.
632 * @param text Display text to use. If not a raw line,
633 * the style may automatically add color markup.
634 * No numbering or newlines are needed.
635 * @param style ITEMDRAW style flags.
636 * @return A slot position, or 0 if item was a rawline or could not be drawn.
637 * @error Invalid Handle.
639 native DrawPanelItem(Handle:panel, const String:text[], style=ITEMDRAW_DEFAULT);
642 * Draws a raw line of text on a panel, without any markup other than a newline.
644 * @param panel A MenuPanel Handle, or INVALID_HANDLE if inside a
645 * MenuAction_DisplayItem callback.
646 * @param text Display text to use.
647 * @return True on success, false if raw lines are not supported.
648 * @error Invalid Handle.
650 native DrawPanelText(Handle:panel, const String:text[]);
653 * Returns whether or not the given drawing flags are supported by
656 * @param panel A MenuPanel Handle.
657 * @param style ITEMDRAW style flags.
658 * @return True if item is drawable, false otherwise.
659 * @error Invalid Handle.
661 native CanPanelDrawFlags(Handle:panel, style);
664 * Sets the selectable key map of a panel. This is not supported by
665 * all styles (only by Radio, as of this writing).
667 * @param keys An integer where each bit N allows key
668 * N+1 to be selected. If no keys are selectable,
669 * then key 0 (bit 9) is automatically set.
670 * @return True if supported, false otherwise.
672 native bool:SetPanelKeys(Handle:panel, keys);
675 * Sends a panel to a client. Unlike full menus, the handler
676 * function will only receive the following actions, both of
677 * which will have INVALID_HANDLE for a menu, and the client
680 * MenuAction_Select (param2 will be the key pressed)
681 * MenuAction_Cancel (param2 will be the reason)
683 * Also, if the menu fails to display, no callbacks will be called.
685 * @param panel A MenuPanel Handle.
686 * @param client A client to draw to.
687 * @param handler The MenuHandler function to catch actions with.
688 * @param time Time to hold the menu for.
689 * @return True on success, false on failure.
690 * @error Invalid Handle.
692 native bool:SendPanelToClient(Handle:panel, client, MenuHandler:handler, time);
695 * @brief Returns the amount of text the menu can still hold. If this is
696 * limit is reached or overflowed, the text is silently truncated.
698 * Radio menus: Currently 511 characters (512 bytes).
699 * Valve menus: Currently -1 (no meaning).
701 * @param panel A MenuPanel Handle.
702 * @return Number of characters that the menu can still hold,
703 * or -1 if there is no known limit.
704 * @error Invalid Handle.
706 native GetPanelTextRemaining(Handle:panel);
709 * @brief Returns the current key position.
711 * @param panel A MenuPanel Handle.
712 * @return Current key position starting at 1.
713 * @error Invalid Handle.
715 native GetPanelCurrentKey(Handle:panel);
718 * @brief Sets the next key position. This cannot be used
719 * to traverse backwards.
721 * @param panel A MenuPanel Handle.
722 * @param key Key that is greater or equal to
723 * GetPanelCurrentKey().
724 * @return True on success, false otherwise.
725 * @error Invalid Handle.
727 native bool:SetPanelCurrentKey(Handle:panel, key);
730 * @brief Redraws menu text from inside a MenuAction_DisplayItem callback.
732 * @param text Menu text to draw.
733 * @return Item position; must be returned via the callback.
735 native RedrawMenuItem(const String:text[]);
738 * This function is provided for legacy code only. Some older plugins may use
739 * network messages instead of the panel API. This function wraps the panel
740 * API for eased portability into the SourceMod menu system.
742 * This function is only usable with the Radio Menu style. You do not need to
743 * split up your menu into multiple packets; SourceMod will break the string
746 * @param client Client index.
747 * @param str Full menu string as would be passed over the network.
748 * @param time Time to hold the menu for.
749 * @param keys Selectable key bitstring.
750 * @param handler Optional handler function, with the same rules as
751 * SendPanelToClient().
752 * @return True on success, false on failure.
753 * @error Invalid client index, or radio menus not supported.
755 native bool:InternalShowMenu(client, const String:str[], time, keys=-1, MenuHandler:handler=MenuHandler:-1);
758 * Retrieves voting information from MenuAction_VoteEnd.
760 * @param param2 Second parameter of MenuAction_VoteEnd.
761 * @param winningVotes Number of votes received by the winning option.
762 * @param totalVotes Number of total votes received.
765 stock GetMenuVoteInfo(param2, &winningVotes, &totalVotes)
767 winningVotes = param2 & 0xFFFF;
768 totalVotes = param2 >> 16;
772 * Quick stock to determine whether voting is allowed. This doesn't let you
773 * fine-tune a reason for not voting, so it's not recommended for lazily
774 * telling clients that voting isn't allowed.
776 * @return True if voting is allowed, false if voting is in progress
777 * or the cooldown is active.
779 stock bool:IsNewVoteAllowed()
781 if (IsVoteInProgress() || CheckVoteDelay() != 0)