diff --git a/BigBaseV2/src/gui/window/main/tab_vehicle.cpp b/BigBaseV2/src/gui/window/main/tab_vehicle.cpp index 2c569db4..343d4418 100644 --- a/BigBaseV2/src/gui/window/main/tab_vehicle.cpp +++ b/BigBaseV2/src/gui/window/main/tab_vehicle.cpp @@ -27,8 +27,6 @@ namespace big location = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true); - entity::take_control_of(veh); - vehicle::bring(veh, location); }QUEUE_JOB_END_CLAUSE } diff --git a/BigBaseV2/src/util/vehicle.hpp b/BigBaseV2/src/util/vehicle.hpp index b3776e52..44b800ea 100644 --- a/BigBaseV2/src/util/vehicle.hpp +++ b/BigBaseV2/src/util/vehicle.hpp @@ -1,5 +1,7 @@ #pragma once +#include "entity.hpp" #include "gta/joaat.hpp" +#include "math.hpp" #include "natives.hpp" #include "notify.hpp" #include "pointers.hpp" @@ -9,11 +11,15 @@ namespace big::vehicle { inline void bring(Vehicle veh, Vector3 location, bool put_in = true) { + entity::take_control_of(veh); + ENTITY::SET_ENTITY_COORDS(veh, location.x, location.y, location.z + 1.f, 0, 0, 0, 1); if (put_in) { - script::get_current()->yield(100ms); + for (size_t i = 0; i < 100 && math::distance_between_vectors(location, ENTITY::GET_ENTITY_COORDS(veh, true)) > 10; i++) + script::get_current()->yield(); + PED::SET_PED_INTO_VEHICLE(PLAYER::PLAYER_PED_ID(), veh, -1); } }