From 53c29702349d28af7daf7e7de0510e150694ba96 Mon Sep 17 00:00:00 2001 From: Oldcustard <147gusto@gmail.com> Date: Mon, 6 Mar 2023 17:09:27 +1100 Subject: [PATCH] final updates (i hope) --- scripting/config_loader.sp | 41 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/scripting/config_loader.sp b/scripting/config_loader.sp index 4f93655..c2a9fb5 100644 --- a/scripting/config_loader.sp +++ b/scripting/config_loader.sp @@ -6,7 +6,7 @@ #pragma semicolon 1 #pragma newdecls required -#define PLUGIN_VERSION "0.1" +#define PLUGIN_VERSION "1.0" ConVar g_cvarConfigName; bool g_bConfigLoaded = false; @@ -58,23 +58,23 @@ public void OnMapStart() if (StrEqual(config_name, "variable")) { - g_bConfigLoaded = false; - PrintToServer("[AUTOCONFIG] Config Loaded FALSE"); - PrintToServer("[AUTOCONFIG] Blocking Match Start"); + g_bConfigLoaded = false; + PrintToServer("[AUTOCONFIG] Config Loaded FALSE"); + PrintToServer("[AUTOCONFIG] Blocking Match Start"); } else { - ServerCommand("exec %s", config_name); + ServerCommand("exec %s", config_name); } } public void OnMapEnd() { - KillTimer(g_reminder_timer); - g_bConfigLoaded = false; - g_cvarConfigName.SetString("NULL"); - PrintToServer("[AUTOCONFIG] Config Loaded FALSE"); - PrintToServer("[AUTOCONFIG] Blocking Match Start"); + KillTimer(g_reminder_timer); + g_bConfigLoaded = false; + g_cvarConfigName.SetString("NULL"); + PrintToServer("[AUTOCONFIG] Config Loaded FALSE"); + PrintToServer("[AUTOCONFIG] Blocking Match Start"); } Action PostReminder(Handle timer, any data) @@ -83,8 +83,8 @@ Action PostReminder(Handle timer, any data) { char config_name[64]; g_cvarConfigName.GetString(config_name, sizeof(config_name)); - CPrintToChatAll("{green}Config loaded: %s", config_name); - return Plugin_Handled; + CPrintToChatAll("{green}Config loaded: %s", config_name); + return Plugin_Handled; } else { @@ -97,7 +97,8 @@ Action BlockStart(Event event, const char[] name, bool dontBroadcast) { if (g_bConfigLoaded) { - return Plugin_Continue; + KillTimer(g_reminder_timer); + return Plugin_Continue; } ServerCommand("mp_tournament_restart"); CPrintToChatAll("{yellow}Bad rollout! {default}(Did you forget to exec?)"); @@ -163,11 +164,11 @@ bool LoadConfig(char[] config_name, int maxlength) } void ConfigNameChangeCallback(ConVar convar, const char[] oldValue, const char[] newValue) -{ - if (!StrEqual(newValue, "NULL")) - { - g_bConfigLoaded = true; - PrintToServer("[AUTOCONFIG] Config Loaded TRUE"); - PrintToServer("[AUTOCONFIG] Unblocking Match Start"); - } +{ + if (!StrEqual(newValue, "NULL")) + { + g_bConfigLoaded = true; + PrintToServer("[AUTOCONFIG] Config Loaded TRUE"); + PrintToServer("[AUTOCONFIG] Unblocking Match Start"); + } } \ No newline at end of file