diff --git a/BigBaseV2/src/gui/window/main/tab_teleport.cpp b/BigBaseV2/src/gui/window/main/tab_teleport.cpp index e4afece8..e4d9aec9 100644 --- a/BigBaseV2/src/gui/window/main/tab_teleport.cpp +++ b/BigBaseV2/src/gui/window/main/tab_teleport.cpp @@ -1,6 +1,8 @@ #include "main_tabs.hpp" #include "fiber_pool.hpp" +#include "script_global.hpp" #include "util/teleport.hpp" +#include "util/vehicle.hpp" namespace big { @@ -8,6 +10,10 @@ namespace big { if (ImGui::BeginTabItem("Teleport")) { + ImGui::BeginChild("col1", { 200.f, 0.f }); + + ImGui::Text("Blips:"); + if (ImGui::Button("Waypoint")) { QUEUE_JOB_BEGIN_CLAUSE() @@ -30,6 +36,38 @@ namespace big }QUEUE_JOB_END_CLAUSE } + + ImGui::EndChild(); + ImGui::SameLine(); + ImGui::BeginChild("col2", { 0.f, 0.f }); + + ImGui::Text("Vehicles:"); + + if (ImGui::Button("Bring Personal Vehicle")) + { + QUEUE_JOB_BEGIN_CLAUSE() + { + Vehicle veh = *script_global(2810287).at(298).as(); + if (ENTITY::IS_ENTITY_DEAD(veh, false)) return notify::above_map("Invalid vehicle handle..."); + + Vector3 location = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true); + + vehicle::bring(veh, location); + }QUEUE_JOB_END_CLAUSE + } + + if (ImGui::Button("Teleport to Personal Vehicle")) + { + Vehicle veh = *script_global(2810287).at(298).as(); + if (ENTITY::IS_ENTITY_DEAD(veh, false)) return notify::above_map("Invalid vehicle handle..."); + + teleport::to_coords( + ENTITY::GET_ENTITY_COORDS(veh, true) + ); + } + + ImGui::EndChild(); + ImGui::EndTabItem(); } } diff --git a/BigBaseV2/src/gui/window/main/tab_vehicle.cpp b/BigBaseV2/src/gui/window/main/tab_vehicle.cpp index 80df1711..35947131 100644 --- a/BigBaseV2/src/gui/window/main/tab_vehicle.cpp +++ b/BigBaseV2/src/gui/window/main/tab_vehicle.cpp @@ -20,23 +20,6 @@ namespace big ImGui::Checkbox("God Mode", &g.vehicle.god_mode); ImGui::SameLine(); - if (ImGui::Button("Bring Personal Vehicle")) - { - QUEUE_JOB_BEGIN_CLAUSE() - { - Vector3 location; - - if (!blip::get_blip_location(location, 225, 0) && !blip::get_blip_location(location, 226, 0)) return notify::above_map("No personal vehicle found, was it destroyed?"); - - Vehicle veh = vehicle::get_closest_to_location(location, 2.f); - if (ENTITY::IS_ENTITY_DEAD(veh, false)) return notify::above_map("Invalid vehicle handle..."); - - location = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true); - - vehicle::bring(veh, location); - }QUEUE_JOB_END_CLAUSE - } - if (ImGui::Button("Repair")) { QUEUE_JOB_BEGIN_CLAUSE() diff --git a/BigBaseV2/src/util/teleport.hpp b/BigBaseV2/src/util/teleport.hpp index ccfbaa9c..d39926c2 100644 --- a/BigBaseV2/src/util/teleport.hpp +++ b/BigBaseV2/src/util/teleport.hpp @@ -1,3 +1,4 @@ +#pragma once #include "blip.hpp" #include "entity.hpp" #include "notify.hpp" @@ -98,6 +99,11 @@ namespace big::teleport return true; } + inline void to_coords(Vector3 location) + { + PED::SET_PED_COORDS_KEEP_VEHICLE(PLAYER::PLAYER_PED_ID(), location.x, location.y, location.z + 1.f); + } + inline bool to_blip(int sprite, int color = -1) { Vector3 location;