Update basetriggers.sp for Dystopia compatibility (#2075)
* Update basetriggers.sp for Dystopia compatibility Dystopia has a built-in command called nextmap which breaks due to the Sourcemod nextmap command. This modification is intended to restore Dystopia compatibility. * Update basetriggers.sp * Update basetriggers.sp * Update basetriggers.sp * Update basetriggers.sp
This commit is contained in:
parent
d4da21b07f
commit
f2ca671d1f
@ -65,6 +65,7 @@ ConVar g_Cvar_MaxRounds;
|
|||||||
#define PRINT_TO_ONE 2 /* Print to a single player */
|
#define PRINT_TO_ONE 2 /* Print to a single player */
|
||||||
|
|
||||||
bool mapchooser;
|
bool mapchooser;
|
||||||
|
bool doNextmap;
|
||||||
|
|
||||||
int g_TotalRounds;
|
int g_TotalRounds;
|
||||||
|
|
||||||
@ -91,16 +92,25 @@ public void OnPluginStart()
|
|||||||
g_Cvar_FriendlyFire = FindConVar("mp_friendlyfire");
|
g_Cvar_FriendlyFire = FindConVar("mp_friendlyfire");
|
||||||
}
|
}
|
||||||
|
|
||||||
RegConsoleCmd("timeleft", Command_Timeleft);
|
char folder[64];
|
||||||
|
GetGameFolderName(folder, sizeof(folder));
|
||||||
|
|
||||||
|
if (strcmp(folder, "dystopia") == 0)
|
||||||
|
{
|
||||||
|
doNextmap = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
RegConsoleCmd("nextmap", Command_Nextmap);
|
RegConsoleCmd("nextmap", Command_Nextmap);
|
||||||
|
doNextmap = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
RegConsoleCmd("timeleft", Command_Timeleft);
|
||||||
RegConsoleCmd("motd", Command_Motd);
|
RegConsoleCmd("motd", Command_Motd);
|
||||||
RegConsoleCmd("ff", Command_FriendlyFire);
|
RegConsoleCmd("ff", Command_FriendlyFire);
|
||||||
|
|
||||||
g_Cvar_TimeleftInterval.AddChangeHook(ConVarChange_TimeleftInterval);
|
g_Cvar_TimeleftInterval.AddChangeHook(ConVarChange_TimeleftInterval);
|
||||||
|
|
||||||
char folder[64];
|
|
||||||
GetGameFolderName(folder, sizeof(folder));
|
|
||||||
|
|
||||||
if (strcmp(folder, "insurgency") == 0)
|
if (strcmp(folder, "insurgency") == 0)
|
||||||
{
|
{
|
||||||
HookEvent("game_newmap", Event_GameStart);
|
HookEvent("game_newmap", Event_GameStart);
|
||||||
@ -300,7 +310,7 @@ public void OnClientSayCommand_Post(int client, const char[] command, const char
|
|||||||
PrintToChat(client,"[SM] %t", "Current Map", map);
|
PrintToChat(client,"[SM] %t", "Current Map", map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (strcmp(sArgs, "nextmap", false) == 0)
|
else if (strcmp(sArgs, "nextmap", false) == 0 && doNextmap)
|
||||||
{
|
{
|
||||||
char map[PLATFORM_MAX_PATH];
|
char map[PLATFORM_MAX_PATH];
|
||||||
GetNextMap(map, sizeof(map));
|
GetNextMap(map, sizeof(map));
|
||||||
|
Loading…
Reference in New Issue
Block a user