From 8df0c5bac97659a7b5c604b89235db7854b5b7bb Mon Sep 17 00:00:00 2001 From: Yimura Date: Sat, 26 Dec 2020 23:47:34 +0100 Subject: [PATCH] feat(TabVehicle): Added Auto Pilot --- BigBaseV2/src/gui/tab_bar/tab_vehicle.cpp | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/BigBaseV2/src/gui/tab_bar/tab_vehicle.cpp b/BigBaseV2/src/gui/tab_bar/tab_vehicle.cpp index f63f8025..56bace6c 100644 --- a/BigBaseV2/src/gui/tab_bar/tab_vehicle.cpp +++ b/BigBaseV2/src/gui/tab_bar/tab_vehicle.cpp @@ -7,6 +7,42 @@ namespace big { if (ImGui::BeginTabItem("Vehicle")) { + if (ImGui::Button("Auto Pilot")) + { + QUEUE_JOB_BEGIN_CLAUSE() + { + Blip blipHandle = HUD::GET_FIRST_BLIP_INFO_ID(8); + Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false); + + if (!veh) + features::notify::above_map("~r~Make sure you are in a vehicle."); + else if (!HUD::DOES_BLIP_EXIST(blipHandle)) + features::notify::above_map("~r~Waypoint needs to be set."); + else + { + Vector3 location = HUD::GET_BLIP_COORDS(blipHandle); + // Make sure the AI can reach this + location = features::teleport::get_ground_at_3d_coord(location); + + TASK::TASK_VEHICLE_DRIVE_TO_COORD(PLAYER::PLAYER_PED_ID(), veh, location.x, location.y, location.z, 35.f, 0, veh, 2883620, 10.f, true); + } + }QUEUE_JOB_END_CLAUSE + } + ImGui::SameLine(); + if (ImGui::Button("Stop Auto Pilot")) + { + QUEUE_JOB_BEGIN_CLAUSE() + { + Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false); + + Vector3 location = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true); + + TASK::TASK_VEHICLE_DRIVE_TO_COORD(PLAYER::PLAYER_PED_ID(), veh, location.x, location.y, location.z, 35.f, 0, veh, 2883620, 10.f, true); + }QUEUE_JOB_END_CLAUSE + } + + ImGui::Separator(); + ImGui::Checkbox("No Bike Fall", g_settings.options["no_bike_fall"].get()); ImGui::Checkbox("Sticky Tyres", g_settings.options["sticky_tyres"].get());