From ef27f9cb6bc02b8192c158d3bee2f4de39b378d2 Mon Sep 17 00:00:00 2001 From: TheGreenBandit <106003542+TheGreenBandit@users.noreply.github.com> Date: Sun, 8 Jan 2023 15:25:15 -0500 Subject: [PATCH] feat(Self): Superjump (#809) --- src/backend/looped/self/beast_jump.cpp | 22 ++++++++++++++++++ src/backend/looped/self/super_jump.cpp | 31 ++++++++++++++++++++++++++ src/core/globals.hpp | 4 +++- src/views/self/view_self.cpp | 5 ++++- 4 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 src/backend/looped/self/beast_jump.cpp create mode 100644 src/backend/looped/self/super_jump.cpp diff --git a/src/backend/looped/self/beast_jump.cpp b/src/backend/looped/self/beast_jump.cpp new file mode 100644 index 00000000..7a657fce --- /dev/null +++ b/src/backend/looped/self/beast_jump.cpp @@ -0,0 +1,22 @@ +#include "natives.hpp" +#include "backend/looped_command.hpp" +#include "gta/enums.hpp" + +namespace big +{ + + class beast_jump_looped : looped_command + { + using looped_command::looped_command; + + virtual void on_tick() override + { + if (PAD::IS_CONTROL_JUST_PRESSED(0, (int)ControllerInputs::INPUT_JUMP) && !PED::IS_PED_IN_ANY_VEHICLE(self::ped, NULL) && !ENTITY::IS_ENTITY_IN_AIR(self::ped)) + { + TASK::TASK_JUMP(self::ped, true, true, true); + } + } + }; + + beast_jump_looped g_beast_jump_looped("beastjump", "Beast Jump", "Allows You To Jump As If You Were The Beast Like In The Beast Event", g.self.beast_jump); +} diff --git a/src/backend/looped/self/super_jump.cpp b/src/backend/looped/self/super_jump.cpp new file mode 100644 index 00000000..1bc81d48 --- /dev/null +++ b/src/backend/looped/self/super_jump.cpp @@ -0,0 +1,31 @@ +#include "natives.hpp" +#include "backend/looped_command.hpp" +#include "gta/enums.hpp" + +namespace big +{ + + class super_jump_looped : looped_command + { + using looped_command::looped_command; + + virtual void on_tick() override + { + if (PAD::IS_CONTROL_JUST_PRESSED(0, (int)ControllerInputs::INPUT_JUMP) && !PED::IS_PED_IN_ANY_VEHICLE(self::ped, NULL) && !ENTITY::IS_ENTITY_IN_AIR(self::ped)) + { + ENTITY::APPLY_FORCE_TO_ENTITY_CENTER_OF_MASS(self::ped, 0, 0, 10000, 5000, true, true, true, false); + } + if (PED::IS_PED_FALLING(self::ped)) + { + TASK::CLEAR_PED_TASKS(self::ped); + } + if (WEAPON::HAS_PED_GOT_WEAPON(self::ped, RAGE_JOAAT("p_parachute_s"), false)) + { + WEAPON::SET_CURRENT_PED_WEAPON(self::ped, RAGE_JOAAT("WEAPON_UNARMED"), true); + } + + } + }; + + super_jump_looped g_super_jump_looped("superjump", "Super Jump", "Allows You To Jump Really High", g.self.super_jump); +} \ No newline at end of file diff --git a/src/core/globals.hpp b/src/core/globals.hpp index c08067f5..e1e64584 100644 --- a/src/core/globals.hpp +++ b/src/core/globals.hpp @@ -262,6 +262,8 @@ namespace big bool mobile_radio = false; bool fast_respawn = false; bool auto_tp = false; + bool super_jump = false; + bool beast_jump = false; // do not save below entries bool dance_mode = false; @@ -271,7 +273,7 @@ namespace big noclip, off_radar, super_run, no_collision, unlimited_oxygen, no_water_collision, wanted_level, god_mode, proof_bullet, proof_fire, proof_collision, proof_melee, proof_explosion, proof_steam, proof_drown, proof_water, proof_mask, hide_radar, hide_ammo, selected_hud_component, hud_components_states, force_show_hud_element, - force_show_hud, mobile_radio, fast_respawn, auto_tp) + force_show_hud, mobile_radio, fast_respawn, auto_tp, super_jump, beast_jump) } self{}; struct session diff --git a/src/views/self/view_self.cpp b/src/views/self/view_self.cpp index 8e7fc6c0..ecac3ae2 100644 --- a/src/views/self/view_self.cpp +++ b/src/views/self/view_self.cpp @@ -41,7 +41,10 @@ namespace big components::command_checkbox<"fastrun">(); ImGui::Checkbox("No Idle Kick", &g.tunables.no_idle_kick); components::command_checkbox<"walkunder">(); - + if(!g.self.super_jump) + components::command_checkbox<"beastjump">(); + if(!g.self.beast_jump) + components::command_checkbox<"superjump">(); ImGui::EndGroup(); ImGui::SameLine(); ImGui::BeginGroup();