From c34ecd60d48bb62f935161fd7b04899c071e5402 Mon Sep 17 00:00:00 2001 From: christian Date: Tue, 27 Apr 2021 00:55:50 +0200 Subject: [PATCH] added delay to prevent bot falling off edges more often --- AutismBotIngame/scripting/autism_bot_info.sp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/AutismBotIngame/scripting/autism_bot_info.sp b/AutismBotIngame/scripting/autism_bot_info.sp index 36ba6702..5b2793e7 100644 --- a/AutismBotIngame/scripting/autism_bot_info.sp +++ b/AutismBotIngame/scripting/autism_bot_info.sp @@ -19,6 +19,7 @@ int target_enemy[MAXPLAYERS + 1]; int buttons_old[MAXPLAYERS + 1]; int flags_old[MAXPLAYERS + 1]; bool surf_cooldown = false; +int bot_avoid_edge[MAXPLAYERS + 1]; float client_old_coords[MAXPLAYERS + 1][3]; float targethuman_teleported[MAXPLAYERS + 1][3]; bool chat_cooldown = false; @@ -314,6 +315,7 @@ public void OnPlayerRunCmdPost(int client, int buttons, int impulse, const float NegateVector(Result); GetVectorAngles(Result, Result); TeleportEntity(client, NULL_VECTOR, Result, NULL_VECTOR); + bot_avoid_edge[client] = 0; } } } @@ -352,6 +354,13 @@ public Action recursive_pressing(Handle timer, any data) ChangeClientTeam(client, 2); continue; } + if (bot_avoid_edge[client] >= 4) + bot_avoid_edge[client] = -1; + if (bot_avoid_edge[client] > -1) + { + bot_avoid_edge[client]++; + continue; + } if (IsPlayerAlive(client)) { int targeteam = 0; @@ -720,6 +729,7 @@ public void OnClientPostAdminCheck(int client) //[U:1:120378081] //[U:1:69566635] target_human_afk_counter[client] = 0; + bot_avoid_edge[client] = -1; char auth[50]; GetClientAuthId(client, AuthId_Engine, auth, sizeof(auth)); char msg[generic_length]; @@ -763,6 +773,7 @@ stock void connect_socket() public void OnClientDisconnect(int client) { admins[client] = false; + bot_avoid_edge[client] = -1; vips[client] = false; client_old_coords[client][0] = 0.0; client_old_coords[client][1] = 0.0;