|
ds@1952
|
1 |
/** |
|
ds@1952
|
2 |
* vim: set ts=4 : |
|
ds@1952
|
3 |
* ============================================================================= |
|
ds@1952
|
4 |
* SourceMod Map Manager Plugin |
|
ds@1952
|
5 |
* Contains globals and defines |
|
ds@1952
|
6 |
* |
|
ds@1952
|
7 |
* SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. |
|
ds@1952
|
8 |
* ============================================================================= |
|
ds@1952
|
9 |
* |
|
ds@1952
|
10 |
* This program is free software; you can redistribute it and/or modify it under |
|
ds@1952
|
11 |
* the terms of the GNU General Public License, version 3.0, as published by the |
|
ds@1952
|
12 |
* Free Software Foundation. |
|
ds@1952
|
13 |
* |
|
ds@1952
|
14 |
* This program is distributed in the hope that it will be useful, but WITHOUT |
|
ds@1952
|
15 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|
ds@1952
|
16 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
|
ds@1952
|
17 |
* details. |
|
ds@1952
|
18 |
* |
|
ds@1952
|
19 |
* You should have received a copy of the GNU General Public License along with |
|
ds@1952
|
20 |
* this program. If not, see <http://www.gnu.org/licenses/>. |
|
ds@1952
|
21 |
* |
|
ds@1952
|
22 |
* As a special exception, AlliedModders LLC gives you permission to link the |
|
ds@1952
|
23 |
* code of this program (as well as its derivative works) to "Half-Life 2," the |
|
ds@1952
|
24 |
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software |
|
ds@1952
|
25 |
* by the Valve Corporation. You must obey the GNU General Public License in |
|
ds@1952
|
26 |
* all respects for all other code used. Additionally, AlliedModders LLC grants |
|
ds@1952
|
27 |
* this exception to all derivative works. AlliedModders LLC defines further |
|
ds@1952
|
28 |
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), |
|
ds@1952
|
29 |
* or <http://www.sourcemod.net/license.php>. |
|
ds@1952
|
30 |
* |
|
ds@1952
|
31 |
* Version: $Id$ |
|
ds@1952
|
32 |
*/ |
|
ds@1952
|
33 |
|
|
ds@1952
|
34 |
#define VOTE_EXTEND "##extend##" |
|
ds@1952
|
35 |
#define VOTE_YES "###yes###" |
|
ds@1952
|
36 |
#define VOTE_NO "###no###" |
|
ds@1952
|
37 |
|
|
ds@1952
|
38 |
new Handle:hTopMenu = INVALID_HANDLE; // TopMenu |
|
ds@1952
|
39 |
|
|
ds@1952
|
40 |
new Handle:g_MapCycle = INVALID_HANDLE; // mapcyclefile maps |
|
ds@1952
|
41 |
new Handle:g_MapList = INVALID_HANDLE; // maplist.txt maps |
|
ds@1952
|
42 |
new Handle:g_MapHistory = INVALID_HANDLE; // History of maps played |
|
ds@1952
|
43 |
new Handle:g_NextVoteMaps = INVALID_HANDLE; // Array of maps for next RTV or MC vote |
|
ds@1952
|
44 |
new Handle:g_NominatedMaps = INVALID_HANDLE; // Array of maps that have been nominated |
|
ds@1952
|
45 |
|
|
ds@1952
|
46 |
new Handle:g_Menu_Map = INVALID_HANDLE; // Menu of maps used by sm_map in admin menu |
|
ds@1952
|
47 |
new Handle:g_Menu_Votemap = INVALID_HANDLE; // Menu of maps used by sm_votemap in admin menu |
|
ds@1952
|
48 |
new Handle:g_Menu_Nominate = INVALID_HANDLE; // Menu of maps used by Nomination system |
|
ds@1952
|
49 |
|
|
ds@1952
|
50 |
new Handle:g_SelectedMaps; // List of maps chosen so far by a user in sm_votemap admin menu |
|
ds@1952
|
51 |
new g_VoteMapInUse; // Client index of admin using sm_votemap |
|
ds@1952
|
52 |
new String:g_Client_Data[MAXCLIENTS+1][64]; // Used to hold bits of client data during sm_votemap |
|
ds@1952
|
53 |
|
|
ds@1952
|
54 |
new bool:g_MapChangeSet; // True if a command or vote has set the map |
|
ds@1952
|
55 |
new bool:g_MapChanged; // True if a map change has been issued |
|
ds@1952
|
56 |
new g_MapChangeWhen; // Either 'i' for immediate, 'r' for round end, or 'e' for end of map. |
|
ds@1952
|
57 |
|
|
ds@1952
|
58 |
new UserMsg:g_VGUIMenu; // VGUI usermsg id for nextmap |
|
ds@1952
|
59 |
new bool:g_NextMapEnabled = true // If set to false, all features requiring nextmap are disabled. |
|
ds@1952
|
60 |
new bool:g_IntermissionCalled; // Has the end of map intermission begun? |
|
ds@1952
|
61 |
new String:g_NextMap[64]; // All important! This is the next map! |
|
ds@1952
|
62 |
new g_MapPos = -1; // Position in mapcycle |
|
ds@1952
|
63 |
|
|
ds@1952
|
64 |
new bool:g_RTV_Voted[MAXPLAYERS+1] = {false, ...}; // Whether or not a player has voted for RTV |
|
ds@1952
|
65 |
new bool:g_RTV_Allowed = false; // True if RTV is available to players. Used to delay rtv votes. |
|
ds@1952
|
66 |
new bool:g_RTV_Started = false; // Indicates that the actual map vote has started |
|
ds@1952
|
67 |
new bool:g_RTV_Ended = false; // Indicates that the actual map vote has concluded |
|
ds@1952
|
68 |
new g_RTV_Voters = 0; // Total voters connected. Doesn't include fake clients. |
|
ds@1952
|
69 |
new g_RTV_Votes = 0; // Total number of "say rtv" votes |
|
ds@1952
|
70 |
new g_RTV_VotesNeeded = 0; // Necessary votes before map vote begins. (voters * percent_needed) |
|
ds@1952
|
71 |
|
|
ds@1952
|
72 |
new bool:g_Nominated[MAXPLAYERS+1] = {false, ...}; // Whether or not a player has nominated a map |
|
ds@1952
|
73 |
|
|
ds@1952
|
74 |
new Handle:g_TeamScores = INVALID_HANDLE; // Array of team scores |
|
ds@1952
|
75 |
new g_TotalRounds; // Total rounds played this map |
|
ds@1952
|
76 |
new bool:g_HasVoteStarted; // Whether or not MapChooser has begun |
|
ds@1952
|
77 |
|
|
ds@1952
|
78 |
// ConVar handles |
|
ds@1952
|
79 |
new Handle:g_Cvar_NextMap = INVALID_HANDLE; |
|
ds@1952
|
80 |
new Handle:g_Cvar_VoteMap = INVALID_HANDLE; |
|
ds@1952
|
81 |
new Handle:g_Cvar_Excludes = INVALID_HANDLE; |
|
ds@1952
|
82 |
new Handle:g_Cvar_StartTime = INVALID_HANDLE; |
|
ds@1952
|
83 |
new Handle:g_Cvar_StartRounds = INVALID_HANDLE; |
|
ds@1952
|
84 |
new Handle:g_Cvar_StartFrags = INVALID_HANDLE; |
|
ds@1952
|
85 |
new Handle:g_Cvar_ExtendTimeMax = INVALID_HANDLE; |
|
ds@1952
|
86 |
new Handle:g_Cvar_ExtendTimeStep = INVALID_HANDLE; |
|
ds@1952
|
87 |
new Handle:g_Cvar_ExtendRoundMax = INVALID_HANDLE; |
|
ds@1952
|
88 |
new Handle:g_Cvar_ExtendRoundStep = INVALID_HANDLE; |
|
ds@1952
|
89 |
new Handle:g_Cvar_ExtendFragMax = INVALID_HANDLE; |
|
ds@1952
|
90 |
new Handle:g_Cvar_ExtendFragStep = INVALID_HANDLE; |
|
ds@1952
|
91 |
new Handle:g_Cvar_Mapfile = INVALID_HANDLE; |
|
ds@1952
|
92 |
new Handle:g_Cvar_ExcludeMaps = INVALID_HANDLE; |
|
ds@1952
|
93 |
new Handle:g_Cvar_IncludeMaps = INVALID_HANDLE; |
|
ds@1952
|
94 |
new Handle:g_Cvar_NoVoteMode = INVALID_HANDLE; |
|
ds@1952
|
95 |
new Handle:g_Cvar_Extend = INVALID_HANDLE; |
|
ds@1952
|
96 |
|
|
ds@1952
|
97 |
new Handle:g_VoteTimer = INVALID_HANDLE; |
|
ds@1952
|
98 |
new Handle:g_RetryTimer = INVALID_HANDLE; |
|
ds@1952
|
99 |
|
|
ds@1952
|
100 |
// VALVe ConVars |
|
ds@1952
|
101 |
new Handle:g_Cvar_Chattime = INVALID_HANDLE; |
|
ds@1952
|
102 |
new Handle:g_Cvar_Winlimit = INVALID_HANDLE; |
|
ds@1952
|
103 |
new Handle:g_Cvar_Maxrounds = INVALID_HANDLE; |
|
ds@1952
|
104 |
new Handle:g_Cvar_Fraglimit = INVALID_HANDLE; |