Don't even bother trying to compile these, it's not finished. Just committing for archiving purposes, this is not intended for 1.0 release.
3 * =============================================================================
4 * SourceMod Map Manager Plugin
5 * Contains event callbacks
7 * SourceMod (C)2004-2007 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 public Action:UserMsg_VGUIMenu(UserMsg:msg_id, Handle:bf, const players[], playersNum, bool:reliable, bool:init)
36 if (g_IntermissionCalled)
38 return Plugin_Handled;
43 /* If we don't get a valid string, bail out. */
44 if (BfReadString(bf, type, sizeof(type)) < 0)
46 return Plugin_Handled;
49 if (BfReadByte(bf) == 1 && BfReadByte(bf) == 0 && (strcmp(type, "scores", false) == 0))
51 g_IntermissionCalled = true;
54 new Float:fChatTime = GetConVarFloat(g_Cvar_Chattime);
58 SetConVarFloat(g_Cvar_Chattime, 2.0);
61 LogMessage("[MapManager] Changing map to '%s' due to map ending.", g_NextMap);
64 CreateTimer(fChatTime - 1.0, Timer_ChangeMap);
67 return Plugin_Handled;
70 public Event_RoundEnd(Handle:event, const String:name[], bool:dontBroadcast)
77 if (g_MapChangeSet && g_MapChangeWhen == 'r')
79 LogMessage("[MapManager] Changing map to '%s' due to round ending.", g_NextMap);
82 CreateTimer(1.0, Timer_ChangeMap);
92 new winner = GetEventInt(event, "winner");
94 if (winner == 0 || winner == 1)
101 new team[2], teamPos = -1;
102 for (new i; i < GetArraySize(g_TeamScores); i++)
104 GetArrayArray(g_TeamScores, i, team);
105 if (team[0] == winner)
116 PushArrayArray(g_TeamScores, team);
121 SetArrayArray(g_TeamScores, teamPos, team);
124 if (g_Cvar_Winlimit != INVALID_HANDLE)
126 new winlimit = GetConVarInt(g_Cvar_Winlimit);
129 if (team[1] >= (winlimit - GetConVarInt(g_Cvar_StartRounds)))
136 if (g_Cvar_Maxrounds != INVALID_HANDLE)
138 new maxrounds = GetConVarInt(g_Cvar_Maxrounds);
141 if (g_TotalRounds >= (maxrounds - GetConVarInt(g_Cvar_StartRounds)))
149 public Event_PlayerDeath(Handle:event, const String:name[], bool:dontBroadcast)
151 if (g_MapChanged || g_HasVoteStarted || g_Cvar_Fraglimit == INVALID_HANDLE)
156 if (!GetConVarInt(g_Cvar_Fraglimit))
161 new fragger = GetClientOfUserId(GetEventInt(event, "attacker"));
162 if (fragger && GetClientFrags(fragger) >= (GetConVarInt(g_Cvar_Fraglimit) - GetConVarInt(g_Cvar_StartFrags)))