From caf674479cff699d3fc8117d3fe69224a40f8e93 Mon Sep 17 00:00:00 2001 From: jenz Date: Wed, 31 Jan 2024 00:36:51 +0100 Subject: [PATCH] hopefully fixed that its always detected when bots are missing --- ZombieRiot/scripting/unloze_zr.sp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ZombieRiot/scripting/unloze_zr.sp b/ZombieRiot/scripting/unloze_zr.sp index 1a5cc94f..4a008e0e 100644 --- a/ZombieRiot/scripting/unloze_zr.sp +++ b/ZombieRiot/scripting/unloze_zr.sp @@ -158,6 +158,7 @@ public Action CheckPlayerTeam(Handle timer, any userid) if (client == 0) return Plugin_Continue; + checkIfRestartNeeded(); if (!IsValidClient(client) || IsPlayerAlive(client) || (GetClientTeam(client) != CS_TEAM_T && GetClientTeam(client) != CS_TEAM_CT) || IsFakeClient(client)) { @@ -210,7 +211,7 @@ public Action Timer_CheckIfRestartNeeded(Handle timer, any userid) return Plugin_Handled; } -public Action ApplySettings(Event event, const char[] name, bool dontBroadcast) +public void checkIfRestartNeeded() { int activeBots = 0; int activePlayers = 0; @@ -237,7 +238,11 @@ public Action ApplySettings(Event event, const char[] name, bool dontBroadcast) { CreateTimer(10.0, Timer_CheckIfRestartNeeded); //if only one guy is on a team we force a restart to spawn the bots. } +} +public Action ApplySettings(Event event, const char[] name, bool dontBroadcast) +{ + checkIfRestartNeeded(); int client = GetClientOfUserId(event.GetInt("userid")); if (!IsValidClient(client) || !IsPlayerAlive(client) || IsClientSourceTV(client))