From 14d969828b2ee0ca3c0da766e64e3ba0b378560a Mon Sep 17 00:00:00 2001 From: yasmasdas <114929405+yasmasdas@users.noreply.github.com> Date: Sat, 4 Feb 2023 23:49:44 +0100 Subject: [PATCH] feat: added boat pickup, ballistic armor and keep on ground (#932) --- src/backend/looped/self/request_services.cpp | 29 +++++++++++++++++++ src/backend/looped/vehicle/keep_on_ground.cpp | 17 +++++++++++ src/core/globals.hpp | 3 +- src/util/mobile.hpp | 12 ++++++++ src/views/self/view_mobile.cpp | 3 ++ src/views/vehicle/view_vehicle.cpp | 1 + 6 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 src/backend/looped/self/request_services.cpp create mode 100644 src/backend/looped/vehicle/keep_on_ground.cpp diff --git a/src/backend/looped/self/request_services.cpp b/src/backend/looped/self/request_services.cpp new file mode 100644 index 00000000..3797ccde --- /dev/null +++ b/src/backend/looped/self/request_services.cpp @@ -0,0 +1,29 @@ +#include "backend/command.hpp" +#include "script_global.hpp" +#include "util/mobile.hpp" + +namespace big +{ + class boat_pickup : command + { + using command::command; + + virtual void execute(const std::vector&, const std::shared_ptr ctx) + { + mobile::merry_weather::request_boat_pickup(); + } + }; + + class ballistic_armor : command + { + using command::command; + + virtual void execute(const std::vector&, const std::shared_ptr ctx) + { + mobile::ceo_abilities::request_ballistic_armor(); + } + }; + + boat_pickup g_boat_pickup("boatpickup", "Request Boat Pickup", "Request a boat pickup", 0); + ballistic_armor g_ballistic_armor("ballisticarmor", "Request Ballistic Equipment", "Requests ballistic equipment which includes ballistic armor and an minigun", 0); +} \ No newline at end of file diff --git a/src/backend/looped/vehicle/keep_on_ground.cpp b/src/backend/looped/vehicle/keep_on_ground.cpp new file mode 100644 index 00000000..3e525f1c --- /dev/null +++ b/src/backend/looped/vehicle/keep_on_ground.cpp @@ -0,0 +1,17 @@ +#include "natives.hpp" +#include "backend/looped_command.hpp" + +namespace big +{ + class keep_on_ground : looped_command + { + using looped_command::looped_command; + + virtual void on_tick() override + { + VEHICLE::SET_VEHICLE_ON_GROUND_PROPERLY(self::veh, 5.0); + } + }; + + keep_on_ground g_keep_on_ground("keeponground", "Keep On Ground", "Makes it so your vehicle is always on the ground on all four wheels", g.vehicle.keep_on_ground); +} \ No newline at end of file diff --git a/src/core/globals.hpp b/src/core/globals.hpp index a03d5051..bc85bdf6 100644 --- a/src/core/globals.hpp +++ b/src/core/globals.hpp @@ -551,6 +551,7 @@ namespace big bool vehinvisibility = false; bool localveh_visibility = false; bool localped_visibility = true; + bool keep_on_ground = false; NLOHMANN_DEFINE_TYPE_INTRUSIVE(vehicle, speedo_meter, fly, rainbow_paint, speed_unit, god_mode, @@ -558,7 +559,7 @@ namespace big auto_drive_destination, auto_drive_style, auto_drive_speed, auto_turn_signals, boost_behavior, drive_on_water, horn_boost, instant_brake, block_homing, seatbelt, turn_signals, vehicle_jump, keep_vehicle_repaired, no_water_collision, disable_engine_auto_start, change_engine_state_immediately, - vehinvisibility, localveh_visibility, localped_visibility) + vehinvisibility, localveh_visibility, localped_visibility, keep_on_ground) } vehicle{}; struct weapons diff --git a/src/util/mobile.hpp b/src/util/mobile.hpp index 25cf06a3..085172a7 100644 --- a/src/util/mobile.hpp +++ b/src/util/mobile.hpp @@ -39,6 +39,11 @@ namespace big::mobile *script_global(scr_globals::mechanic_global).at(886).as() = 1; } + inline void request_boat_pickup() + { + *script_global(scr_globals::mechanic_global).at(887).as() = 1; + } + inline void request_helicopter_pickup() { *script_global(scr_globals::mechanic_global).at(888).as() = 1; @@ -53,6 +58,8 @@ namespace big::mobile { *script_global(scr_globals::mechanic_global).at(4485).as() = 1; } + + } namespace mors_mutual @@ -101,6 +108,11 @@ namespace big::mobile { *script_global(2672505).at(3689).as() = 1; } + + inline void request_ballistic_armor() //i think this is a ceo ability atleast? + { + *script_global(scr_globals::mechanic_global).at(896).as() = 1; + } } namespace mechanic diff --git a/src/views/self/view_mobile.cpp b/src/views/self/view_mobile.cpp index 339eb964..6698c790 100644 --- a/src/views/self/view_mobile.cpp +++ b/src/views/self/view_mobile.cpp @@ -19,6 +19,8 @@ namespace big mobile::merry_weather::request_helicopter_pickup(); }); + components::command_button<"boatpickup">(); + components::button("MW_BACKUP_HELI"_T, [] { mobile::merry_weather::request_backup_helicopter(); }); @@ -44,5 +46,6 @@ namespace big mobile::ceo_abilities::request_bullshark_testosterone(); }); + components::command_button<"ballisticarmor">(); } } \ No newline at end of file diff --git a/src/views/vehicle/view_vehicle.cpp b/src/views/vehicle/view_vehicle.cpp index 5ed6cdb0..9b1ca320 100644 --- a/src/views/vehicle/view_vehicle.cpp +++ b/src/views/vehicle/view_vehicle.cpp @@ -97,6 +97,7 @@ namespace big ImGui::Checkbox("FULLY_AUTOMATIC_SIGNAL"_T.data(), &g.vehicle.auto_turn_signals); } components::command_checkbox<"driveunder">(); + components::command_checkbox<"keeponground">(); ImGui::EndGroup(); }