made bots go spec if no humans on t or CT team
This commit is contained in:
parent
91e7c75f03
commit
6e814e5974
@ -3,7 +3,7 @@
|
||||
#define DEBUG
|
||||
|
||||
#define PLUGIN_AUTHOR "jenz"
|
||||
#define PLUGIN_VERSION "1.7"
|
||||
#define PLUGIN_VERSION "1.8"
|
||||
#define generic_length 256
|
||||
|
||||
#include <sourcemod>
|
||||
@ -471,11 +471,21 @@ public Action recursive_pressing(Handle timer, any data)
|
||||
for (int client = 1; client <= MaxClients; client++)
|
||||
{
|
||||
if (!IsValidClient(client)) continue;
|
||||
if (!is_bot_player(client) && GetClientTeam(client) == 3 && IsPlayerAlive(client))
|
||||
if (!is_bot_player(client) && GetClientTeam(client) > 1)
|
||||
{
|
||||
found_valid_ct = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int client = 1; client <= MaxClients; client++)
|
||||
{
|
||||
if (!IsValidClient(client)) continue;
|
||||
if (!found_valid_ct && is_bot_player(client))
|
||||
{
|
||||
if (GetClientTeam(client) != 0)
|
||||
ChangeClientTeam(client, 0);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_bot_player(client))
|
||||
{
|
||||
if (GetClientTeam(client) == 1 || GetClientTeam(client) == 0)
|
||||
@ -540,7 +550,12 @@ public Action recursive_pressing(Handle timer, any data)
|
||||
GetEntPropVector(target_enemy[client], Prop_Send, "m_vecOrigin", pos);
|
||||
enemy_distance = get_power_distance(client, pos);
|
||||
}
|
||||
if (IsValidClient(target_friend[client]))
|
||||
float max_range_dist = 500.0;
|
||||
if (0 < dist_target < max_range_dist && IsValidClient(target_enemy[client]))
|
||||
{
|
||||
face_call(target_enemy[client], client);
|
||||
}
|
||||
else if (IsValidClient(target_friend[client]))
|
||||
face_call(target_friend[client], client);
|
||||
else if (IsValidClient(target_enemy[client]) && !admins[target_enemy[client]] && !vips[target_enemy[client]])
|
||||
{
|
||||
@ -577,6 +592,16 @@ public Action recursive_pressing(Handle timer, any data)
|
||||
}
|
||||
}
|
||||
}
|
||||
found_valid_ct = false;
|
||||
for (int client = 1; client <= MaxClients; client++)
|
||||
{
|
||||
if (!IsValidClient(client)) continue;
|
||||
if (!is_bot_player(client) && GetClientTeam(client) == 3 && IsPlayerAlive(client))
|
||||
{
|
||||
found_valid_ct = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found_valid_ct)
|
||||
{
|
||||
for (int client = 1; client <= MaxClients; client++)
|
||||
@ -806,7 +831,7 @@ public int GetClosestClient_option1(bool finding_friend, int client)
|
||||
for (int i = 1; i <= MaxClients; i++)
|
||||
if (IsValidClient(i) && IsPlayerAlive(i) && i != client && !is_bot_player(i))
|
||||
{
|
||||
if (!IsAbleToSee(client, i) || is_client_stuck_or_afk(client, i))
|
||||
if (!IsAbleToSee(client, i) || is_client_stuck_or_afk(client, i) || admins[i])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user