|
pred@2077
|
1 |
/** |
|
pred@2077
|
2 |
* vim: set ts=4 : |
|
pred@2077
|
3 |
* ============================================================================= |
|
pred@2077
|
4 |
* SourceMod |
|
pred@2077
|
5 |
* Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. |
|
pred@2077
|
6 |
* ============================================================================= |
|
pred@2077
|
7 |
* |
|
pred@2077
|
8 |
* This program is free software; you can redistribute it and/or modify it under |
|
pred@2077
|
9 |
* the terms of the GNU General Public License, version 3.0, as published by the |
|
pred@2077
|
10 |
* Free Software Foundation. |
|
pred@2077
|
11 |
* |
|
pred@2077
|
12 |
* This program is distributed in the hope that it will be useful, but WITHOUT |
|
pred@2077
|
13 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|
pred@2077
|
14 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
|
pred@2077
|
15 |
* details. |
|
pred@2077
|
16 |
* |
|
pred@2077
|
17 |
* You should have received a copy of the GNU General Public License along with |
|
pred@2077
|
18 |
* this program. If not, see <http://www.gnu.org/licenses/>. |
|
pred@2077
|
19 |
* |
|
pred@2077
|
20 |
* As a special exception, AlliedModders LLC gives you permission to link the |
|
pred@2077
|
21 |
* code of this program (as well as its derivative works) to "Half-Life 2," the |
|
pred@2077
|
22 |
* "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software |
|
pred@2077
|
23 |
* by the Valve Corporation. You must obey the GNU General Public License in |
|
pred@2077
|
24 |
* all respects for all other code used. Additionally, AlliedModders LLC grants |
|
pred@2077
|
25 |
* this exception to all derivative works. AlliedModders LLC defines further |
|
pred@2077
|
26 |
* exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), |
|
pred@2077
|
27 |
* or <http://www.sourcemod.net/license.php>. |
|
pred@2077
|
28 |
* |
|
pred@2077
|
29 |
* Version: $Id$ |
|
pred@2077
|
30 |
*/ |
|
pred@2077
|
31 |
|
|
pred@2077
|
32 |
#include "sm_globals.h" |
|
pred@2077
|
33 |
#include "NextMap.h" |
|
pred@2077
|
34 |
|
|
pred@2077
|
35 |
static cell_t sm_GetNextMap(IPluginContext *pCtx, const cell_t *params) |
|
pred@2077
|
36 |
{ |
|
pred@2077
|
37 |
const char *map = g_NextMap.GetNextMap(); |
|
pred@2077
|
38 |
|
|
pred@2077
|
39 |
if (map[0] == 0) |
|
pred@2077
|
40 |
{ |
|
pred@2077
|
41 |
return 0; |
|
pred@2077
|
42 |
} |
|
pred@2077
|
43 |
|
|
pred@2077
|
44 |
pCtx->StringToLocal(params[1], params[2], map); |
|
pred@2077
|
45 |
|
|
pred@2077
|
46 |
return 1; |
|
pred@2077
|
47 |
} |
|
pred@2077
|
48 |
|
|
pred@2077
|
49 |
static cell_t sm_SetNextMap(IPluginContext *pCtx, const cell_t *params) |
|
pred@2077
|
50 |
{ |
|
pred@2077
|
51 |
char *map; |
|
pred@2077
|
52 |
pCtx->LocalToString(params[1], &map); |
|
pred@2077
|
53 |
|
|
pred@2077
|
54 |
return g_NextMap.SetNextMap(map); |
|
pred@2077
|
55 |
} |
|
pred@2077
|
56 |
|
|
pred@2077
|
57 |
|
|
pred@2077
|
58 |
REGISTER_NATIVES(nextmapnatives) |
|
pred@2077
|
59 |
{ |
|
pred@2077
|
60 |
{"GetNextMap", sm_GetNextMap}, |
|
pred@2077
|
61 |
{"SetNextMap", sm_SetNextMap}, |
|
pred@2077
|
62 |
{NULL, NULL}, |
|
pred@2077
|
63 |
}; |