ferret99gt@1789: /**
ferret99gt@1789: * vim: set ts=4 :
ferret99gt@1789: * =============================================================================
ferret99gt@1789: * SourceMod Basecommands Plugin
ferret99gt@1789: * Provides map functionality
ferret99gt@1789: *
ds@1947: * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved.
ferret99gt@1789: * =============================================================================
ferret99gt@1789: *
ferret99gt@1789: * This program is free software; you can redistribute it and/or modify it under
ferret99gt@1789: * the terms of the GNU General Public License, version 3.0, as published by the
ferret99gt@1789: * Free Software Foundation.
ferret99gt@1789: *
ferret99gt@1789: * This program is distributed in the hope that it will be useful, but WITHOUT
ferret99gt@1789: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
ferret99gt@1789: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
ferret99gt@1789: * details.
ferret99gt@1789: *
ferret99gt@1789: * You should have received a copy of the GNU General Public License along with
ferret99gt@1789: * this program. If not, see .
ferret99gt@1789: *
ferret99gt@1789: * As a special exception, AlliedModders LLC gives you permission to link the
ferret99gt@1789: * code of this program (as well as its derivative works) to "Half-Life 2," the
ferret99gt@1789: * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
ferret99gt@1789: * by the Valve Corporation. You must obey the GNU General Public License in
ferret99gt@1789: * all respects for all other code used. Additionally, AlliedModders LLC grants
ferret99gt@1789: * this exception to all derivative works. AlliedModders LLC defines further
ferret99gt@1789: * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
ferret99gt@1789: * or .
ferret99gt@1789: *
ds@1990: * Version: $Id$
ferret99gt@1789: */
ferret99gt@1789:
pred@1536: public MenuHandler_ChangeMap(Handle:menu, MenuAction:action, param1, param2)
pred@1536: {
pred@1536: if (action == MenuAction_Cancel)
pred@1536: {
pred@1536: if (param2 == MenuCancel_ExitBack && hTopMenu != INVALID_HANDLE)
pred@1536: {
pred@1536: DisplayTopMenu(hTopMenu, param1, TopMenuPosition_LastCategory);
pred@1536: }
pred@1536: }
pred@1536: else if (action == MenuAction_Select)
pred@1536: {
pred@1536: decl String:map[64];
pred@1536:
pred@1536: GetMenuItem(menu, param2, map, sizeof(map));
pred@1536:
dvander@1623: ShowActivity2(param1, "[SM] ", "%t", "Changing map", map);
pred@1536:
pred@1536: LogAction(param1, -1, "\"%L\" changed map to \"%s\"", param1, map);
pred@1536:
pred@1536: new Handle:dp;
pred@1536: CreateDataTimer(3.0, Timer_ChangeMap, dp);
pred@1536: WritePackString(dp, map);
pred@1536:
pred@1536: }
pred@1536: }
pred@1536:
pred@1536: public AdminMenu_Map(Handle:topmenu,
pred@1536: TopMenuAction:action,
pred@1536: TopMenuObject:object_id,
pred@1536: param,
pred@1536: String:buffer[],
pred@1536: maxlength)
pred@1536: {
pred@1536: if (action == TopMenuAction_DisplayOption)
pred@1536: {
pred@1536: Format(buffer, maxlength, "%T", "Choose Map", param);
pred@1536: }
pred@1536: else if (action == TopMenuAction_SelectOption)
pred@1536: {
pred@1536: DisplayMenu(g_MapList, param, MENU_TIME_FOREVER);
pred@1536: }
pred@1536: }
pred@1536:
pred@1536: public Action:Command_Map(client, args)
pred@1536: {
pred@1536: if (args < 1)
pred@1536: {
pred@1536: ReplyToCommand(client, "[SM] Usage: sm_map