added auto slay if last humans are bots

This commit is contained in:
christian 2021-06-29 01:12:10 +02:00
parent 17a9c52b20
commit dbfeca91e6

View File

@ -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;
}