diff --git a/BigBaseV2/src/backend/backend.cpp b/BigBaseV2/src/backend/backend.cpp index 125a29a4..c4f5f229 100644 --- a/BigBaseV2/src/backend/backend.cpp +++ b/BigBaseV2/src/backend/backend.cpp @@ -88,6 +88,7 @@ namespace big looped::vehicle_drive_on_water(); looped::vehicle_god_mode(); looped::vehicle_horn_boost(); + looped::vehicle_instant_brake(); looped::vehicle_is_targetable(); looped::vehicle_rainbow_paint(); looped::vehicle_speedo_meter(); @@ -98,4 +99,4 @@ namespace big looped::vehicle_ls_customs(); }QUEUE_JOB_END_CLAUSE } -} \ No newline at end of file +} diff --git a/BigBaseV2/src/backend/looped/looped.hpp b/BigBaseV2/src/backend/looped/looped.hpp index 3c4a18a9..f1f84f0d 100644 --- a/BigBaseV2/src/backend/looped/looped.hpp +++ b/BigBaseV2/src/backend/looped/looped.hpp @@ -38,6 +38,7 @@ namespace big static void vehicle_drive_on_water(); static void vehicle_god_mode(); static void vehicle_horn_boost(); + static void vehicle_instant_brake(); static void vehicle_is_targetable(); static void vehicle_ls_customs(); static void vehicle_rainbow_paint(); @@ -57,4 +58,4 @@ namespace big static void weapons_steal_vehicle_gun(); static void weapons_vehicle_gun(); }; -} \ No newline at end of file +} diff --git a/BigBaseV2/src/backend/looped/vehicle/instant_brake.cpp b/BigBaseV2/src/backend/looped/vehicle/instant_brake.cpp new file mode 100644 index 00000000..d6c3ee6c --- /dev/null +++ b/BigBaseV2/src/backend/looped/vehicle/instant_brake.cpp @@ -0,0 +1,21 @@ +#include "backend/looped/looped.hpp" +#include "gta/enums.hpp" +#include "natives.hpp" + +namespace big +{ + + void looped::vehicle_instant_brake() + { + if (!g->vehicle.instant_brake) return; + + const Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false); + if (veh == 0 || ENTITY::GET_ENTITY_SPEED_VECTOR(veh, true).y < 1.f) + { + return; + } + + if (PAD::IS_CONTROL_PRESSED(0, 33)) + VEHICLE::SET_VEHICLE_FORWARD_SPEED(veh, 0); + } +} diff --git a/BigBaseV2/src/core/globals.hpp b/BigBaseV2/src/core/globals.hpp index 395f92cd..91dd34b2 100644 --- a/BigBaseV2/src/core/globals.hpp +++ b/BigBaseV2/src/core/globals.hpp @@ -194,6 +194,7 @@ namespace big bool drive_on_water = false; bool god_mode = false; bool horn_boost = false; + bool instant_brake = false; bool is_targetable = true; bool ls_customs = false; // don't save this to disk bool pv_teleport_into = false; @@ -428,6 +429,7 @@ namespace big this->vehicle.drive_on_water = j["vehicle"]["drive_on_water"]; this->vehicle.god_mode = j["vehicle"]["god_mode"]; this->vehicle.horn_boost = j["vehicle"]["horn_boost"]; + this->vehicle.instant_brake = j["vehicle"]["instant_brake"]; this->vehicle.is_targetable = j["vehicle"]["is_targetable"]; this->vehicle.pv_teleport_into = j["vehicle"]["pv_teleport_into"]; this->vehicle.rainbow_paint = j["vehicle"]["rainbow_paint"]; @@ -631,6 +633,7 @@ namespace big { "drive_on_water", this->vehicle.drive_on_water }, { "god_mode", this->vehicle.god_mode }, { "horn_boost", this->vehicle.horn_boost }, + { "instant_brake", this->vehicle.instant_brake }, { "is_targetable", this->vehicle.is_targetable }, { "pv_teleport_into", this->vehicle.pv_teleport_into }, { "rainbow_paint", this->vehicle.rainbow_paint }, diff --git a/BigBaseV2/src/services/vehicle_preview_service.cpp b/BigBaseV2/src/services/vehicle_preview_service.cpp index 97db7f08..aa77ae08 100644 --- a/BigBaseV2/src/services/vehicle_preview_service.cpp +++ b/BigBaseV2/src/services/vehicle_preview_service.cpp @@ -51,13 +51,12 @@ namespace big auto location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER::PLAYER_PED_ID(), 2.5f, 2.5f, .5f); if (m_current_veh == -1) { + m_new_model = false; location.z = -10.f; m_current_veh = vehicle::spawn(m_model, location, 0.f, false); ENTITY::FREEZE_ENTITY_POSITION(m_current_veh, true); ENTITY::SET_ENTITY_ALPHA(m_current_veh, 0, 0); ENTITY::SET_ENTITY_COLLISION(m_current_veh, false, false); - - m_new_model = false; } else if (m_new_model) { @@ -117,4 +116,4 @@ namespace big LOG(WARNING) << "Failed to load vehicles.json:\n" << ex.what(); } } -} \ No newline at end of file +} diff --git a/BigBaseV2/src/util/toxic.hpp b/BigBaseV2/src/util/toxic.hpp index ea484a50..91a86f92 100644 --- a/BigBaseV2/src/util/toxic.hpp +++ b/BigBaseV2/src/util/toxic.hpp @@ -3,6 +3,7 @@ #include "natives.hpp" #include "script_global.hpp" #include "system.hpp" +#include "entity.hpp" namespace big::toxic { @@ -65,6 +66,25 @@ namespace big::toxic TASK::CLEAR_PED_TASKS_IMMEDIATELY(target); } + + inline void flying_vehicle(const Player player) + { + Entity ent = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player); + + if (!PED::IS_PED_IN_ANY_VEHICLE(ent, true)) + g_notification_service->push_warning("Toxic", "Target player is not in a vehicle."); + else { + ent = PED::GET_VEHICLE_PED_IS_IN(ent, false); + + Vector3 location = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true); + + if (entity::take_control_of(ent)) + ENTITY::APPLY_FORCE_TO_ENTITY(ent, 1, 0.f, 0.f, 50000.f, 0.f, 0.f, 0.f, 0, 0, 1, 1, 0, 1); + else + g_notification_service->push_warning("Toxic", "Failed to take control of player vehicle."); + } + } + inline void clear_wanted_player(Player target) { diff --git a/BigBaseV2/src/views/players/view_player.cpp b/BigBaseV2/src/views/players/view_player.cpp index 36b73f1d..5ac81b7e 100644 --- a/BigBaseV2/src/views/players/view_player.cpp +++ b/BigBaseV2/src/views/players/view_player.cpp @@ -125,7 +125,11 @@ namespace big components::button("Kick From Vehicle", [] { toxic::kick_from_vehicle(g_player_service->get_selected()->id()); }); + + components::button("Flying Vehicle", [] { + toxic::flying_vehicle(g_player_service->get_selected()->id()); + }); } } } -} +} \ No newline at end of file diff --git a/BigBaseV2/src/views/vehicle/view_vehicle.cpp b/BigBaseV2/src/views/vehicle/view_vehicle.cpp index f02ffc8b..dedac9b7 100644 --- a/BigBaseV2/src/views/vehicle/view_vehicle.cpp +++ b/BigBaseV2/src/views/vehicle/view_vehicle.cpp @@ -11,6 +11,7 @@ namespace big ImGui::Checkbox("Can Be Targeted", &g->vehicle.is_targetable); ImGui::Checkbox("God Mode", &g->vehicle.god_mode); ImGui::Checkbox("Horn Boost", &g->vehicle.horn_boost); + ImGui::Checkbox("Instant Brake", &g->vehicle.instant_brake); ImGui::Checkbox("Drive On Water", &g->vehicle.drive_on_water); ImGui::EndGroup();