From dbfeca91e6a2c57e2b12a2f591ecfbe037d12c88 Mon Sep 17 00:00:00 2001 From: christian Date: Tue, 29 Jun 2021 01:12:10 +0200 Subject: [PATCH] added auto slay if last humans are bots --- AutismBotIngame/scripting/autism_bot_info.sp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/AutismBotIngame/scripting/autism_bot_info.sp b/AutismBotIngame/scripting/autism_bot_info.sp index 15a4331c..b51df7bf 100644 --- a/AutismBotIngame/scripting/autism_bot_info.sp +++ b/AutismBotIngame/scripting/autism_bot_info.sp @@ -413,9 +413,14 @@ public bool is_bot_player(int client) public Action recursive_pressing(Handle timer, any data) { + bool found_valid_ct = false; for (int client = 1; client <= MaxClients; client++) { if (!IsValidClient(client)) continue; + if (!is_bot_player(client) && GetClientTeam(client) == 3) + { + found_valid_ct = true; + } if (is_bot_player(client)) { if (GetClientTeam(client) == 1 || GetClientTeam(client) == 0) @@ -517,6 +522,17 @@ public Action recursive_pressing(Handle timer, any data) } } } + if (!found_valid_ct) + { + for (int client = 1; client <= MaxClients; client++) + { + if (!IsValidClient(client)) continue; + if (is_bot_player(client) && GetClientTeam(client) == 3) + { + ForcePlayerSuicide(client); + } + } + } return Plugin_Continue; }