3 * =============================================================================
4 * SourceMod Map Management Plugin
5 * Contains misc functions.
7 * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
8 * =============================================================================
10 * This program is free software; you can redistribute it and/or modify it under
11 * the terms of the GNU General Public License, version 3.0, as published by the
12 * Free Software Foundation.
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19 * You should have received a copy of the GNU General Public License along with
20 * this program. If not, see <http://www.gnu.org/licenses/>.
22 * As a special exception, AlliedModders LLC gives you permission to link the
23 * code of this program (as well as its derivative works) to "Half-Life 2," the
24 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
25 * by the Valve Corporation. You must obey the GNU General Public License in
26 * all respects for all other code used. Additionally, AlliedModders LLC grants
27 * this exception to all derivative works. AlliedModders LLC defines further
28 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
29 * or <http://www.sourcemod.net/license.php>.
34 DisplayWhenMenu(client, bool:vote = false)
40 menu = CreateMenu(MenuHandler_ChangeMap);
44 menu = CreateMenu(MenuHandler_VoteWhen);
47 decl String:title[100];
48 Format(title, sizeof(title), "%T:", "Map Change When", client);
49 SetMenuTitle(menu, title);
50 SetMenuExitBackButton(menu, true);
52 AddMenuItem(menu, "i", "Immediately");
53 AddMenuItem(menu, "r", "Round End");
54 AddMenuItem(menu, "e", "Map End");
56 DisplayMenu(menu, client, MENU_TIME_FOREVER);
59 DisplayConfirmVoteMenu(client)
61 new Handle:menu = CreateMenu(MenuHandler_Confirm);
63 decl String:title[100];
64 Format(title, sizeof(title), "%T:", "Confirm Vote", client);
65 SetMenuTitle(menu, title);
66 SetMenuExitBackButton(menu, true);
68 AddMenuItem(menu, "Confirm", "Start the Vote");
70 DisplayMenu(menu, client, MENU_TIME_FOREVER);
73 DisplayAcceptVoteMenu(String:map[])
75 new Handle:menu = CreateMenu(MenuHandler_Accept);
77 decl String:title[100];
78 Format(title, sizeof(title), "%T:", "Accept Vote", client);
79 SetMenuTitle(menu, title);
80 SetMenuExitBackButton(menu, true);
82 AddMenuItem(menu, map, "Accept Vote");
84 DisplayMenu(menu, g_VoteMapInUse, MENU_TIME_FOREVER);
87 DisplayVoteMapMenu(client, mapCount, String:maps[5][])
89 LogAction(client, -1, "\"%L\" initiated a map vote.", client);
90 ShowActivity2(client, "[SM] ", "%t", "Initiated Vote Map");
92 new Handle:menu = CreateMenu(Handler_VoteCallback, MenuAction:MENU_ACTIONS_ALL);
96 //strcopy(g_voteInfo[VOTE_NAME], sizeof(g_voteInfo[]), maps[0]);
98 SetMenuTitle(menu, "Change Map To");
99 AddMenuItem(menu, maps[0], "Yes");
100 AddMenuItem(menu, VOTE_NO, "No");
104 //g_voteInfo[VOTE_NAME][0] = '\0';
106 SetMenuTitle(menu, "Map Vote");
107 for (new i = 0; i < mapCount; i++)
109 AddMenuItem(menu, maps[i], maps[i]);
113 SetMenuExitButton(menu, false);
114 VoteMenuToAll(menu, 20);