From b787c2ec63385491b4da064e1861618a62523530 Mon Sep 17 00:00:00 2001 From: Oldcustard <147gusto@gmail.com> Date: Sat, 15 Jul 2023 15:59:09 +1000 Subject: [PATCH] add oneshot blocking feature --- scripting/config_loader.sp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripting/config_loader.sp b/scripting/config_loader.sp index 941231e..78ad858 100644 --- a/scripting/config_loader.sp +++ b/scripting/config_loader.sp @@ -10,6 +10,7 @@ ConVar g_cvarConfigName; bool g_bConfigLoaded = false; +bool g_bBlocked = false; Handle g_reminder_timer; public Plugin myinfo = @@ -72,6 +73,7 @@ public void OnMapEnd() { KillTimer(g_reminder_timer); g_bConfigLoaded = false; + g_bBlocked = false; g_cvarConfigName.SetString("NULL"); PrintToServer("[AUTOCONFIG] Config Loaded FALSE"); PrintToServer("[AUTOCONFIG] Blocking Match Start"); @@ -95,14 +97,16 @@ Action PostReminder(Handle timer, any data) Action BlockStart(Event event, const char[] name, bool dontBroadcast) { - if (g_bConfigLoaded) + if (g_bConfigLoaded || g_bBlocked) { KillTimer(g_reminder_timer); PrintToServer("[AUTOCONFIG] Match started, going silent."); return Plugin_Continue; } + g_bBlocked = true; ServerCommand("mp_tournament_restart"); 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; }