Update CS:GO team score gamedata.
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 _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 */
91 #define MENUFLAG_BUTTON_NOVOTE (1<<3) /**< Menu has a "No Vote" button at slot 1 */
93 #define VOTEINFO_CLIENT_INDEX 0 /**< Client index */
94 #define VOTEINFO_CLIENT_ITEM 1 /**< Item the client selected, or -1 for none */
95 #define VOTEINFO_ITEM_INDEX 0 /**< Item index */
96 #define VOTEINFO_ITEM_VOTES 1 /**< Number of votes for the item */
98 #define VOTEFLAG_NO_REVOTES (1<<0) /**< Players cannot change their votes */
101 * Reasons a menu can be cancelled (MenuAction_Cancel).
105 MenuCancel_Disconnected = -1, /**< Client dropped from the server */
106 MenuCancel_Interrupted = -2, /**< Client was interrupted with another menu */
107 MenuCancel_Exit = -3, /**< Client exited via "exit" */
108 MenuCancel_NoDisplay = -4, /**< Menu could not be displayed to the client */
109 MenuCancel_Timeout = -5, /**< Menu timed out */
110 MenuCancel_ExitBack = -6, /**< Client selected "exit back" on a paginated menu */
114 * Reasons a vote can be cancelled (MenuAction_VoteCancel).
118 VoteCancel_Generic = -1, /**< Vote was generically cancelled. */
119 VoteCancel_NoVotes = -2, /**< Vote did not receive any votes. */
123 * Reasons a menu ended (MenuAction_End).
127 MenuEnd_Selected = 0, /**< Menu item was selected */
128 MenuEnd_VotingDone = -1, /**< Voting finished */
129 MenuEnd_VotingCancelled = -2, /**< Voting was cancelled */
130 MenuEnd_Cancelled = -3, /**< Menu was cancelled (reason in param2) */
131 MenuEnd_Exit = -4, /**< Menu was cleanly exited via "exit" */
132 MenuEnd_ExitBack = -5, /**< Menu was cleanly exited via "back" */
136 * Describes a menu's source
140 MenuSource_None = 0, /**< No menu is being displayed */
141 MenuSource_External = 1, /**< External menu */
142 MenuSource_Normal = 2, /**< A basic menu is being displayed */
143 MenuSource_RawPanel = 3, /**< A display is active, but it is not tied to a menu */
147 * Called when a menu action is completed.
149 * @param menu The menu being acted upon.
150 * @param action The action of the menu.
151 * @param param1 First action parameter (usually the client).
152 * @param param2 Second action parameter (usually the item).
155 functag public MenuHandler(Handle:menu, MenuAction:action, param1, param2);
158 * Creates a new, empty menu using the default style.
160 * @param handler Function which will receive menu actions.
161 * @param actions Optionally set which actions to receive. Select,
162 * Cancel, and End will always be received regardless
163 * of whether they are set or not. They are also
164 * the only default actions.
165 * @return A new menu Handle.
167 native Handle:CreateMenu(MenuHandler:handler, MenuAction:actions=MENU_ACTIONS_DEFAULT);
170 * Displays a menu to a client.
172 * @param menu Menu Handle.
173 * @param client Client index.
174 * @param time Maximum time to leave menu on the screen.
175 * @return True on success, false on failure.
176 * @error Invalid Handle or client not in game.
178 native bool:DisplayMenu(Handle:menu, client, time);
181 * Displays a menu to a client, starting from the given item.
183 * @param menu Menu Handle.
184 * @param client Client index.
185 * @param first_item First item to begin drawing from.
186 * @param time Maximum time to leave menu on the screen.
187 * @return True on success, false on failure.
188 * @error Invalid Handle or client not in game.
190 native bool:DisplayMenuAtItem(Handle:menu, client, first_item, time);
193 * Appends a new item to the end of a menu.
195 * @param menu Menu Handle.
196 * @param info Item information string.
197 * @param display Default item display string.
198 * @param style Drawing style flags. Anything other than DEFAULT or
199 * DISABLED will be completely ignored when paginating.
200 * @return True on success, false on failure.
201 * @error Invalid Handle or item limit reached.
203 native AddMenuItem(Handle:menu,
205 const String:display[],
206 style=ITEMDRAW_DEFAULT);
209 * Inserts an item into the menu before a certain position; the new item will
210 * be at the given position and all next items pushed forward.
212 * @param menu Menu Handle.
213 * @param position Position, starting from 0.
214 * @param info Item information string.
215 * @param display Default item display string.
216 * @param style Drawing style flags. Anything other than DEFAULT or
217 * DISABLED will be completely ignored when paginating.
218 * @return True on success, false on failure.
219 * @error Invalid Handle or menu position.
221 native bool:InsertMenuItem(Handle:menu,
224 const String:display[],
225 style=ITEMDRAW_DEFAULT);
228 * Removes an item from the menu.
230 * @param menu Menu Handle.
231 * @param position Position, starting from 0.
232 * @return True on success, false on failure.
233 * @error Invalid Handle or menu position.
235 native bool:RemoveMenuItem(Handle:menu, position);
238 * Removes all items from a menu.
240 * @param menu Menu Handle.
242 * @error Invalid Handle or menu position.
244 native RemoveAllMenuItems(Handle:menu);
247 * Retrieves information about a menu item.
249 * @param menu Menu Handle.
250 * @param position Position, starting from 0.
251 * @param infoBuf Info buffer.
252 * @param infoBufLen Maximum length of the info buffer.
253 * @param style By-reference variable to store drawing flags.
254 * @param dispBuf Display buffer.
255 * @param dispBufLen Maximum length of the display buffer.
256 * @return True on success, false if position is invalid.
257 * @error Invalid Handle.
259 native bool:GetMenuItem(Handle:menu,
268 * Returns the first item on the page of a currently selected menu.
270 * This is only valid inside a MenuAction_Select callback.
272 * @return First item number on the page the client was viewing
273 * before selecting the item in the callback. This can
274 * be used to re-display the menu from the original
276 * @error Not called from inside a MenuAction_Select callback.
278 native GetMenuSelectionPosition();
281 * Returns the number of items in a menu.
283 * @param menu Menu Handle.
284 * @return Number of items in the menu.
285 * @error Invalid Handle.
287 native GetMenuItemCount(Handle:menu);
290 * Sets whether the menu should be paginated or not.
292 * If itemsPerPage is MENU_NO_PAGINATION, and the exit button flag is set,
293 * then the exit button flag is removed. It can be re-applied if desired.
295 * @param menu Handle to the menu.
296 * @param itemsPerPage Number of items per page, or MENU_NO_PAGINATION.
297 * @return True on success, false if pagination is too high or
299 * @error Invalid Handle.
301 native bool:SetMenuPagination(Handle:menu, itemsPerPage);
304 * Returns a menu's pagination setting.
306 * @param menu Handle to the menu.
307 * @return Pagination setting.
308 * @error Invalid Handle.
310 native GetMenuPagination(Handle:menu);
313 * Returns a menu's MenuStyle Handle. The Handle
314 * is global and cannot be freed.
316 * @param menu Handle to the menu.
317 * @return Handle to the menu's draw style.
318 * @error Invalid Handle.
320 native Handle:GetMenuStyle(Handle:menu);
323 * Sets the menu's default title/instruction message.
325 * @param menu Menu Handle.
326 * @param fmt Message string format
327 * @param ... Message string arguments.
329 * @error Invalid Handle.
331 native SetMenuTitle(Handle:menu, const String:fmt[], any:...);
334 * Returns the text of a menu's title.
336 * @param menu Menu Handle.
337 * @param buffer Buffer to store title.
338 * @param maxlength Maximum length of the buffer.
339 * @return Number of bytes written.
340 * @error Invalid Handle/
342 native GetMenuTitle(Handle:menu, String:buffer[], maxlength);
345 * Creates a raw MenuPanel based off the menu's style.
346 * The Handle must be freed with CloseHandle().
348 * @param menu Menu Handle.
349 * @return A new MenuPanel Handle.
350 * @error Invalid Handle.
352 native Handle:CreatePanelFromMenu(Handle:menu);
355 * Returns whether or not the menu has an exit button.
356 * By default, menus have an exit button.
358 * @param menu Menu Handle.
359 * @return True if the menu has an exit button; false otherwise.
360 * @error Invalid Handle.
362 native bool:GetMenuExitButton(Handle:menu);
365 * Sets whether or not the menu has an exit button. By default, paginated menus
366 * have an exit button.
368 * If a menu's pagination is changed to MENU_NO_PAGINATION, and the pagination
369 * was previously a different value, then the Exit button status is changed to
370 * false. It must be explicitly re-enabled afterwards.
372 * If a non-paginated menu has an exit button, then at most 9 items will be
375 * @param menu Menu Handle.
376 * @param button True to enable the button, false to remove it.
377 * @return True if allowed; false on failure.
378 * @error Invalid Handle.
380 native bool:SetMenuExitButton(Handle:menu, bool:button);
383 * Returns whether or not the menu has an "exit back" button. By default,
384 * menus do not have an exit back button.
386 * Exit Back buttons appear as "Back" on page 1 of paginated menus and have
387 * functionality defined by the user in MenuEnd_ExitBack.
389 * @param menu Menu Handle.
390 * @return True if the menu has an exit back button; false otherwise.
391 * @error Invalid Handle.
393 native bool:GetMenuExitBackButton(Handle:menu);
396 * Sets whether or not the menu has an "exit back" button. By default, menus
397 * do not have an exit back button.
399 * Exit Back buttons appear as "Back" on page 1 of paginated menus and have
400 * functionality defined by the user in MenuEnd_ExitBack.
402 * @param menu Menu Handle.
403 * @param button True to enable the button, false to remove it.
404 * @error Invalid Handle.
406 native SetMenuExitBackButton(Handle:menu, bool:button);
409 * Sets whether or not the menu has a "no vote" button in slot 1.
410 * By default, menus do not have a no vote button.
412 * @param menu Menu Handle.
413 * @param button True to enable the button, false to remove it.
414 * @return True if allowed; false on failure.
415 * @error Invalid Handle.
417 native bool:SetMenuNoVoteButton(Handle:menu, bool:button);
420 * Cancels a menu from displaying on all clients. While the
421 * cancellation is in progress, this menu cannot be re-displayed
424 * The menu may still exist on the client's screen after this command.
425 * This simply verifies that the menu is not being used anywhere.
427 * If any vote is in progress on a menu, it will be cancelled.
429 * @param menu Menu Handle.
431 * @error Invalid Handle.
433 native CancelMenu(Handle:menu);
436 * Retrieves a menu's option flags.
438 * @param menu Menu Handle.
439 * @return A bitstring of MENUFLAG bits.
440 * @error Invalid Handle.
442 native GetMenuOptionFlags(Handle:menu);
445 * Sets a menu's option flags.
447 * If a certain bit is not supported, it will be stripped before being set.
448 * See SetMenuExitButton() for information on Exit buttons.
449 * See SetMenuExitBackButton() for information on Exit Back buttons.
451 * @param menu Menu Handle.
452 * @param flags A new bitstring of MENUFLAG bits.
454 * @error Invalid Handle.
456 native SetMenuOptionFlags(Handle:menu, flags);
459 * Returns whether a vote is in progress.
461 * @param menu Deprecated; no longer used.
462 * @return True if a vote is in progress, false otherwise.
464 native bool:IsVoteInProgress(Handle:menu=INVALID_HANDLE);
467 * Cancels the vote in progress.
470 * @error If no vote is in progress.
475 * Broadcasts a menu to a list of clients. The most selected item will be
476 * returned through MenuAction_End. On a tie, a random item will be returned
477 * from a list of the tied items.
479 * Note that MenuAction_VoteEnd and MenuAction_VoteStart are both
480 * default callbacks and do not need to be enabled.
482 * @param menu Menu Handle.
483 * @param clients Array of clients to broadcast to.
484 * @param numClients Number of clients in the array.
485 * @param time Maximum time to leave menu on the screen.
486 * @param flags Optional voting flags.
487 * @return True on success, false if this menu already has a vote session
489 * @error Invalid Handle, or a vote is already in progress.
491 native bool:VoteMenu(Handle:menu, clients[], numClients, time, flags=0);
494 * Sends a vote menu to all clients. See VoteMenu() for more information.
496 * @param menu Menu Handle.
497 * @param time Maximum time to leave menu on the screen.
498 * @param flags Optional voting flags.
499 * @return True on success, false if this menu already has a vote session
501 * @error Invalid Handle.
503 stock bool:VoteMenuToAll(Handle:menu, time, flags=0)
506 decl players[MaxClients];
508 for (new i=1; i<=MaxClients; i++)
510 if (!IsClientInGame(i) || IsFakeClient(i))
514 players[total++] = i;
517 return VoteMenu(menu, players, total, time, flags);
520 * Callback for when a vote has ended and results are available.
522 * @param menu The menu being voted on.
523 * @param num_votes Number of votes tallied in total.
524 * @param num_clients Number of clients who could vote.
525 * @param client_info Array of clients. Use VOTEINFO_CLIENT_ defines.
526 * @param num_items Number of unique items that were selected.
527 * @param item_info Array of items, sorted by count. Use VOTEINFO_ITEM
531 functag public VoteHandler(Handle:menu,
534 const client_info[][2],
536 const item_info[][2]);
539 * Sets an advanced vote handling callback. If this callback is set,
540 * MenuAction_VoteEnd will not be called.
542 * @param menu Menu Handle.
543 * @param callback Callback function.
545 * @error Invalid Handle or callback.
547 native SetVoteResultCallback(Handle:menu, VoteHandler:callback);
550 * Returns the number of seconds you should "wait" before displaying
551 * a publicly invocable menu. This number is the time remaining until
552 * (last_vote + sm_vote_delay).
554 * @return Number of seconds to wait, or 0 for none.
556 native CheckVoteDelay();
559 * Returns whether a client is in the pool of clients allowed
560 * to participate in the current vote. This is determined by
561 * the client list passed to VoteMenu().
563 * @param client Client index.
564 * @return True if client is allowed to vote, false otherwise.
565 * @error If no vote is in progress or client index is invalid.
567 native bool:IsClientInVotePool(client);
570 * Redraws the current vote menu to a client in the voting pool.
572 * @param client Client index.
573 * @param revotes True to allow revotes, false otherwise.
574 * @return True on success, false if the client is in the vote pool
575 * but cannot vote again.
576 * @error No vote in progress, client is not in the voting pool,
577 * or client index is invalid.
579 native bool:RedrawClientVoteMenu(client, bool:revotes=true);
582 * Returns a style's global Handle.
584 * @param style Menu Style.
585 * @return A Handle, or INVALID_HANDLE if not found or unusable.
587 native Handle:GetMenuStyleHandle(MenuStyle:style);
590 * Creates a MenuPanel from a MenuStyle. Panels are used for drawing raw
591 * menus without any extra helper functions. The Handle must be closed
592 * with CloseHandle().
594 * @param hStyle MenuStyle Handle, or INVALID_HANDLE to use the default style.
595 * @return A new MenuPanel Handle.
596 * @error Invalid Handle other than INVALID_HANDLE.
598 native Handle:CreatePanel(Handle:hStyle=INVALID_HANDLE);
601 * Creates a Menu from a MenuStyle. The Handle must be closed with
604 * @param hStyle MenuStyle Handle, or INVALID_HANDLE to use the default style.
605 * @param handler Function which will receive menu actions.
606 * @param actions Optionally set which actions to receive. Select,
607 * Cancel, and End will always be received regardless
608 * of whether they are set or not. They are also
609 * the only default actions.
610 * @return A new menu Handle.
611 * @error Invalid Handle other than INVALID_HANDLE.
613 native Handle:CreateMenuEx(Handle:hStyle=INVALID_HANDLE, MenuHandler:handler, MenuAction:actions=MENU_ACTIONS_DEFAULT);
616 * Returns whether a client is viewing a menu.
618 * @param client Client index.
619 * @param hStyle MenuStyle Handle, or INVALID_HANDLE to use the default style.
620 * @return A MenuSource value.
621 * @error Invalid Handle other than INVALID_HANDLE.
623 native MenuSource:GetClientMenu(client, Handle:hStyle=INVALID_HANDLE);
626 * Cancels a menu on a client. This will only affect non-external menus.
628 * @param hStyle MenuStyle Handle, or INVALID_HANDLE to use the default style.
629 * @param client Client index.
630 * @param autoIgnore If true, no menus can be re-drawn on the client during
631 * the cancellation process.
632 * @return True if a menu was cancelled, false otherwise.
634 native bool:CancelClientMenu(client, bool:autoIgnore=false, Handle:hStyle=INVALID_HANDLE);
637 * Returns a style's maximum items per page.
639 * @param hStyle MenuStyle Handle, or INVALID_HANDLE to use the default style.
640 * @return Maximum items per page.
641 * @error Invalid Handle other than INVALID_HANDLE.
643 native GetMaxPageItems(Handle:hStyle=INVALID_HANDLE);
646 * Returns a MenuPanel's parent style.
648 * @param panel A MenuPanel Handle.
649 * @return The MenuStyle Handle that created the panel.
650 * @error Invalid Handle.
652 native Handle:GetPanelStyle(Handle:panel);
655 * Sets the panel's title.
657 * @param panel A MenuPanel Handle.
658 * @param text Text to set as the title.
659 * @param onlyIfEmpty If true, the title will only be set if no title is set.
661 * @error Invalid Handle.
663 native Handle:SetPanelTitle(Handle:panel, const String:text[], bool:onlyIfEmpty=false);
666 * Draws an item on a panel. If the item takes up a slot, the position
669 * @param panel A MenuPanel Handle.
670 * @param text Display text to use. If not a raw line,
671 * the style may automatically add color markup.
672 * No numbering or newlines are needed.
673 * @param style ITEMDRAW style flags.
674 * @return A slot position, or 0 if item was a rawline or could not be drawn.
675 * @error Invalid Handle.
677 native DrawPanelItem(Handle:panel, const String:text[], style=ITEMDRAW_DEFAULT);
680 * Draws a raw line of text on a panel, without any markup other than a newline.
682 * @param panel A MenuPanel Handle, or INVALID_HANDLE if inside a
683 * MenuAction_DisplayItem callback.
684 * @param text Display text to use.
685 * @return True on success, false if raw lines are not supported.
686 * @error Invalid Handle.
688 native DrawPanelText(Handle:panel, const String:text[]);
691 * Returns whether or not the given drawing flags are supported by
694 * @param panel A MenuPanel Handle.
695 * @param style ITEMDRAW style flags.
696 * @return True if item is drawable, false otherwise.
697 * @error Invalid Handle.
699 native CanPanelDrawFlags(Handle:panel, style);
702 * Sets the selectable key map of a panel. This is not supported by
703 * all styles (only by Radio, as of this writing).
705 * @param panel A MenuPanel Handle.
706 * @param keys An integer where each bit N allows key
707 * N+1 to be selected. If no keys are selectable,
708 * then key 0 (bit 9) is automatically set.
709 * @return True if supported, false otherwise.
711 native bool:SetPanelKeys(Handle:panel, keys);
714 * Sends a panel to a client. Unlike full menus, the handler
715 * function will only receive the following actions, both of
716 * which will have INVALID_HANDLE for a menu, and the client
719 * MenuAction_Select (param2 will be the key pressed)
720 * MenuAction_Cancel (param2 will be the reason)
722 * Also, if the menu fails to display, no callbacks will be called.
724 * @param panel A MenuPanel Handle.
725 * @param client A client to draw to.
726 * @param handler The MenuHandler function to catch actions with.
727 * @param time Time to hold the menu for.
728 * @return True on success, false on failure.
729 * @error Invalid Handle.
731 native bool:SendPanelToClient(Handle:panel, client, MenuHandler:handler, time);
734 * @brief Returns the amount of text the menu can still hold. If this is
735 * limit is reached or overflowed, the text is silently truncated.
737 * Radio menus: Currently 511 characters (512 bytes).
738 * Valve menus: Currently -1 (no meaning).
740 * @param panel A MenuPanel Handle.
741 * @return Number of characters that the menu can still hold,
742 * or -1 if there is no known limit.
743 * @error Invalid Handle.
745 native GetPanelTextRemaining(Handle:panel);
748 * @brief Returns the current key position.
750 * @param panel A MenuPanel Handle.
751 * @return Current key position starting at 1.
752 * @error Invalid Handle.
754 native GetPanelCurrentKey(Handle:panel);
757 * @brief Sets the next key position. This cannot be used
758 * to traverse backwards.
760 * @param panel A MenuPanel Handle.
761 * @param key Key that is greater or equal to
762 * GetPanelCurrentKey().
763 * @return True on success, false otherwise.
764 * @error Invalid Handle.
766 native bool:SetPanelCurrentKey(Handle:panel, key);
769 * @brief Redraws menu text from inside a MenuAction_DisplayItem callback.
771 * @param text Menu text to draw.
772 * @return Item position; must be returned via the callback.
774 native RedrawMenuItem(const String:text[]);
777 * This function is provided for legacy code only. Some older plugins may use
778 * network messages instead of the panel API. This function wraps the panel
779 * API for eased portability into the SourceMod menu system.
781 * This function is only usable with the Radio Menu style. You do not need to
782 * split up your menu into multiple packets; SourceMod will break the string
785 * @param client Client index.
786 * @param str Full menu string as would be passed over the network.
787 * @param time Time to hold the menu for.
788 * @param keys Selectable key bitstring.
789 * @param handler Optional handler function, with the same rules as
790 * SendPanelToClient().
791 * @return True on success, false on failure.
792 * @error Invalid client index, or radio menus not supported.
794 native bool:InternalShowMenu(client, const String:str[], time, keys=-1, MenuHandler:handler=MenuHandler:-1);
797 * Retrieves voting information from MenuAction_VoteEnd.
799 * @param param2 Second parameter of MenuAction_VoteEnd.
800 * @param winningVotes Number of votes received by the winning option.
801 * @param totalVotes Number of total votes received.
804 stock GetMenuVoteInfo(param2, &winningVotes, &totalVotes)
806 winningVotes = param2 & 0xFFFF;
807 totalVotes = param2 >> 16;
811 * Quick stock to determine whether voting is allowed. This doesn't let you
812 * fine-tune a reason for not voting, so it's not recommended for lazily
813 * telling clients that voting isn't allowed.
815 * @return True if voting is allowed, false if voting is in progress
816 * or the cooldown is active.
818 stock bool:IsNewVoteAllowed()
820 if (IsVoteInProgress() || CheckVoteDelay() != 0)