Compare commits

..

No commits in common. "master" and "v1.0" have entirely different histories.
master ... v1.0

View File

@ -6,11 +6,10 @@
#pragma semicolon 1 #pragma semicolon 1
#pragma newdecls required #pragma newdecls required
#define PLUGIN_VERSION "1.1" #define PLUGIN_VERSION "1.0"
ConVar g_cvarConfigName; ConVar g_cvarConfigName;
bool g_bConfigLoaded = false; bool g_bConfigLoaded = false;
bool g_bBlocked = false;
Handle g_reminder_timer; Handle g_reminder_timer;
public Plugin myinfo = public Plugin myinfo =
@ -52,7 +51,7 @@ public void OnMapStart()
* @note Precache your models, sounds, etc. here! * @note Precache your models, sounds, etc. here!
* Not in OnConfigsExecuted! Doing so leads to issues. * Not in OnConfigsExecuted! Doing so leads to issues.
*/ */
g_reminder_timer = CreateTimer(60.0, PostReminder, 0, TIMER_REPEAT); g_reminder_timer = CreateTimer(15.0, PostReminder, 0, TIMER_REPEAT);
char config_name[64]; char config_name[64];
LoadConfig(config_name, sizeof(config_name)); LoadConfig(config_name, sizeof(config_name));
@ -73,7 +72,6 @@ public void OnMapEnd()
{ {
KillTimer(g_reminder_timer); KillTimer(g_reminder_timer);
g_bConfigLoaded = false; g_bConfigLoaded = false;
g_bBlocked = false;
g_cvarConfigName.SetString("NULL"); g_cvarConfigName.SetString("NULL");
PrintToServer("[AUTOCONFIG] Config Loaded FALSE"); PrintToServer("[AUTOCONFIG] Config Loaded FALSE");
PrintToServer("[AUTOCONFIG] Blocking Match Start"); PrintToServer("[AUTOCONFIG] Blocking Match Start");
@ -97,17 +95,13 @@ Action PostReminder(Handle timer, any data)
Action BlockStart(Event event, const char[] name, bool dontBroadcast) Action BlockStart(Event event, const char[] name, bool dontBroadcast)
{ {
if (g_bConfigLoaded || g_bBlocked) if (g_bConfigLoaded)
{ {
KillTimer(g_reminder_timer); KillTimer(g_reminder_timer);
PrintToServer("[AUTOCONFIG] Match started, going silent.");
return Plugin_Continue; return Plugin_Continue;
} }
g_bBlocked = true;
ServerCommand("mp_tournament_restart"); ServerCommand("mp_tournament_restart");
CPrintToChatAll("{yellow}Bad rollout! {default}(Did you forget to exec?)"); CPrintToChatAll("{yellow}Bad rollout! {default}(Did you forget to exec?)");
CPrintToChatAll("{default} RUP again to ignore warning");
PrintToServer("[AUTOCONFIG] Match start blocked due to no config");
return Plugin_Handled; return Plugin_Handled;
} }