diff --git a/BigBaseV2/src/backend/backend.cpp b/BigBaseV2/src/backend/backend.cpp index b24938a7..ff06b3d1 100644 --- a/BigBaseV2/src/backend/backend.cpp +++ b/BigBaseV2/src/backend/backend.cpp @@ -31,6 +31,7 @@ namespace big QUEUE_JOB_BEGIN_CLAUSE() { + looped::vehicle_horn_boost(); looped::vehicle_speedo_meter(); }QUEUE_JOB_END_CLAUSE } diff --git a/BigBaseV2/src/backend/looped/looped.hpp b/BigBaseV2/src/backend/looped/looped.hpp index ba292c69..28bf50e2 100644 --- a/BigBaseV2/src/backend/looped/looped.hpp +++ b/BigBaseV2/src/backend/looped/looped.hpp @@ -15,6 +15,7 @@ namespace big static void weapons_steal_vehicle_gun(); static void weapons_vehicle_gun(); + static void vehicle_horn_boost(); static void vehicle_speedo_meter(); }; } \ No newline at end of file diff --git a/BigBaseV2/src/backend/looped/vehicle/horn_boost.cpp b/BigBaseV2/src/backend/looped/vehicle/horn_boost.cpp new file mode 100644 index 00000000..863be453 --- /dev/null +++ b/BigBaseV2/src/backend/looped/vehicle/horn_boost.cpp @@ -0,0 +1,32 @@ +#include "backend/looped/looped.hpp" +#include "gta/enums.hpp" +#include "natives.hpp" +#include "util/math.hpp" + +namespace big +{ + void looped::vehicle_horn_boost() + { + if (!g.vehicle.horn_boost) return; + + if (PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_VEH_HORN)) + { + Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false); + + if (veh == 0) return; + + Vector3 rot = ENTITY::GET_ENTITY_ROTATION(veh, 2); + float pitch = math::deg_to_rad(rot.x); // vertical + //float roll = rot.y; + float yaw = math::deg_to_rad(rot.z + 90); // horizontal + + Vector3 velocity; + const float dist = 50.f; + velocity.x = dist * cos(pitch) * cos(yaw); + velocity.y = dist * sin(yaw) * cos(pitch); + velocity.z = dist * sin(pitch); + + ENTITY::SET_ENTITY_VELOCITY(veh, velocity.x, velocity.y, velocity.z); + } + } +} \ No newline at end of file diff --git a/BigBaseV2/src/core/globals.hpp b/BigBaseV2/src/core/globals.hpp index 5f3ac7ff..a297aa0c 100644 --- a/BigBaseV2/src/core/globals.hpp +++ b/BigBaseV2/src/core/globals.hpp @@ -15,6 +15,7 @@ struct globals { }; struct vehicle { + bool horn_boost = false; SpeedoMeter speedo_meter = SpeedoMeter::DISABLED; }; @@ -31,6 +32,7 @@ struct globals { { this->self.godmode = j["self"]["godmode"]; + this->vehicle.horn_boost = j["vehicle"]["horn_boost"]; this->vehicle.speedo_meter = (SpeedoMeter)j["vehicle"]["speedo_meter"]; this->weapons.custom_weapon = (CustomWeapon)j["weapons"]["custom_weapon"]; @@ -41,23 +43,18 @@ struct globals { return nlohmann::json{ { "self", { - { - "godmode", this->self.godmode - } + { "godmode", this->self.godmode } } }, { "vehicle", { - { - "speedo_meter", (int)this->vehicle.speedo_meter - } + { "horn_boost", this->vehicle.horn_boost }, + { "speedo_meter", (int)this->vehicle.speedo_meter } } }, { "weapons", { - { - "custom_weapon", (int)this->weapons.custom_weapon - } + { "custom_weapon", (int)this->weapons.custom_weapon } } } }; diff --git a/BigBaseV2/src/gui/window/main/tab_vehicle.cpp b/BigBaseV2/src/gui/window/main/tab_vehicle.cpp index 6746790a..c56e33e7 100644 --- a/BigBaseV2/src/gui/window/main/tab_vehicle.cpp +++ b/BigBaseV2/src/gui/window/main/tab_vehicle.cpp @@ -32,6 +32,8 @@ namespace big ImGui::TreePop(); } + ImGui::Checkbox("Horn Boost", &g.vehicle.horn_boost); + ImGui::EndTabItem(); } }