mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2024-12-22 20:17:24 +08:00
feat: Unlock Interaction Menu, Weapon Explosion Radius Modifier & improve fast respawn(#2489)
This commit is contained in:
parent
22e2c36249
commit
2033288b11
@ -1,8 +1,7 @@
|
||||
#include "backend/looped/looped.hpp"
|
||||
#include "backend/looped_command.hpp"
|
||||
#include "fiber_pool.hpp"
|
||||
#include "gta/enums.hpp"
|
||||
#include "natives.hpp"
|
||||
#include "util/misc.hpp"
|
||||
#include "core/scr_globals.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
@ -12,14 +11,18 @@ namespace big
|
||||
|
||||
virtual void on_tick() override
|
||||
{
|
||||
if (PED::IS_PED_DEAD_OR_DYING(self::ped, true))
|
||||
{
|
||||
PED::RESURRECT_PED(self::ped);
|
||||
ENTITY::SET_ENTITY_COORDS_NO_OFFSET(self::ped, self::pos.x, self::pos.y, self::pos.z, 0, 0, 0);
|
||||
TASK::CLEAR_PED_TASKS_IMMEDIATELY(self::ped);
|
||||
MISC::FORCE_GAME_STATE_PLAYING();
|
||||
MISC::TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME("respawn_controller");
|
||||
}
|
||||
// disable wasted sound cause it's annoying
|
||||
*scr_globals::disable_wasted_sound.as<bool*>() = true;
|
||||
|
||||
// triggers respawn instantly upon death, has no effect if not respawning so no need to check if the player's dead
|
||||
misc::set_bit(&(*scr_globals::freemode_properties.at(1685).at(756).as<int*>()), 1); // Update: freemode -> KILL_STRIP_H -> Above that = "!IS_BIT_SET(global, 2)"
|
||||
}
|
||||
|
||||
virtual void on_disable() override
|
||||
{
|
||||
*scr_globals::disable_wasted_sound.as<bool*>() = false;
|
||||
|
||||
misc::clear_bit(&(*scr_globals::freemode_properties.at(1685).at(756).as<int*>()), 1);
|
||||
}
|
||||
};
|
||||
|
||||
|
17
src/backend/looped/self/interaction_menu_freedom.cpp
Normal file
17
src/backend/looped/self/interaction_menu_freedom.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include "backend/looped_command.hpp"
|
||||
#include "core/scr_globals.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
class interaction_menu_freedom : looped_command
|
||||
{
|
||||
using looped_command::looped_command;
|
||||
|
||||
virtual void on_tick() override
|
||||
{
|
||||
*scr_globals::interaction_menu_access.as<int*>() = 1; // sets itself to the original value every frame while you're in the interaction menu, so no need for a reset
|
||||
}
|
||||
};
|
||||
|
||||
interaction_menu_freedom g_interaction_menu_freedom("interactionmenufreedom", "INTERACTION_MENU_FREEDOM", "INTERACTION_MENU_FREEDOM_DESC", g.self.interaction_menu_freedom);
|
||||
}
|
34
src/backend/looped/weapons/modify_explosion_radius.cpp
Normal file
34
src/backend/looped/weapons/modify_explosion_radius.cpp
Normal file
@ -0,0 +1,34 @@
|
||||
#include "backend/looped_command.hpp"
|
||||
#include "natives.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
class modify_explosion_radius : looped_command
|
||||
{
|
||||
using looped_command::looped_command;
|
||||
|
||||
Hash ped_weapon;
|
||||
|
||||
virtual void on_tick() override
|
||||
{
|
||||
Hash weapon{};
|
||||
WEAPON::GET_CURRENT_PED_WEAPON(self::ped, &weapon, 0);
|
||||
|
||||
if (weapon != ped_weapon)
|
||||
{
|
||||
WEAPON::SET_WEAPON_AOE_MODIFIER(weapon, 1);
|
||||
ped_weapon = weapon;
|
||||
}
|
||||
|
||||
WEAPON::SET_WEAPON_AOE_MODIFIER(weapon, g.weapons.set_explosion_radius);
|
||||
}
|
||||
virtual void on_disable() override
|
||||
{
|
||||
Hash weapon{};
|
||||
WEAPON::GET_CURRENT_PED_WEAPON(self::ped, &weapon, 0);
|
||||
WEAPON::SET_WEAPON_AOE_MODIFIER(weapon, 1);
|
||||
}
|
||||
};
|
||||
|
||||
modify_explosion_radius g_modify_explosion_radius("modifyexplosionradius", "BACKEND_LOOPED_WEAPONS_MODIFY_EXPLOSION_RADIUS", "BACKEND_LOOPED_WEAPONS_MODIFY_EXPLOSION_RADIUS_DESC", g.weapons.modify_explosion_radius);
|
||||
}
|
@ -56,6 +56,10 @@ namespace big::scr_globals
|
||||
|
||||
static inline const script_global gun_van(1956855);
|
||||
|
||||
static inline const script_global interaction_menu_access(2766623); // am_pi_menu -> PI_BIK_13_2_H -> global = true;
|
||||
|
||||
static inline const script_global disable_wasted_sound(2764735); // freemode -> AUDIO::PLAY_SOUND_FRONTEND(-1, "Wasted", "POWER_PLAY_General_Soundset", true);
|
||||
|
||||
static inline const script_global passive(1574582);
|
||||
|
||||
static inline const script_global property_garage(1945123);
|
||||
|
@ -348,6 +348,7 @@ namespace big
|
||||
bool prompt_ambient_animations = false;
|
||||
std::string persist_outfit = "";
|
||||
bool persist_outfits_mis = false;
|
||||
bool interaction_menu_freedom = false;
|
||||
|
||||
struct hud
|
||||
{
|
||||
@ -383,7 +384,7 @@ namespace big
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(super_hero_fly, gradual, explosions, auto_land, charge, ptfx, fly_speed, initial_launch)
|
||||
} super_hero_fly{};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(self, ipls, ptfx_effects, clean_player, force_wanted_level, passive, free_cam, invisibility, local_visibility, never_wanted, no_ragdoll, noclip, noclip_aim_speed_multiplier, noclip_speed_multiplier, off_radar, super_run, no_collision, unlimited_oxygen, no_water_collision, wanted_level, god_mode, part_water, proof_bullet, proof_fire, proof_collision, proof_melee, proof_explosion, proof_steam, proof_drown, proof_water, proof_mask, mobile_radio, fast_respawn, auto_tp, super_jump, beast_jump, healthregen, healthregenrate, hud, superman, custom_weapon_stop, prompt_ambient_animations, persist_outfit, persist_outfits_mis, super_hero_fly)
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(self, ipls, ptfx_effects, clean_player, force_wanted_level, passive, free_cam, invisibility, local_visibility, never_wanted, no_ragdoll, noclip, noclip_aim_speed_multiplier, noclip_speed_multiplier, off_radar, super_run, no_collision, unlimited_oxygen, no_water_collision, wanted_level, god_mode, part_water, proof_bullet, proof_fire, proof_collision, proof_melee, proof_explosion, proof_steam, proof_drown, proof_water, proof_mask, mobile_radio, fast_respawn, auto_tp, super_jump, beast_jump, healthregen, healthregenrate, hud, superman, custom_weapon_stop, prompt_ambient_animations, persist_outfit, persist_outfits_mis, interaction_menu_freedom, super_hero_fly)
|
||||
} self{};
|
||||
|
||||
struct session
|
||||
@ -860,6 +861,8 @@ namespace big
|
||||
bool infinite_mag = false;
|
||||
float increased_damage = 1;
|
||||
bool increase_damage = false;
|
||||
float set_explosion_radius = 1.f;
|
||||
bool modify_explosion_radius = false;
|
||||
bool no_recoil = false;
|
||||
bool no_spread = false;
|
||||
std::string vehicle_gun_model = "bus";
|
||||
@ -872,7 +875,7 @@ namespace big
|
||||
bool enable_weapon_hotkeys = false;
|
||||
std::map<int, std::vector<uint32_t>> weapon_hotkeys{};
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(weapons, ammo_special, custom_weapon, aimbot, infinite_ammo, always_full_ammo, infinite_mag, increased_damage, increase_damage, no_recoil, no_spread, vehicle_gun_model, increased_c4_limit, increased_flare_limit, rapid_fire, gravity_gun, paintgun, interior_weapon, triggerbot, infinite_range, enable_weapon_hotkeys, weapon_hotkeys)
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(weapons, ammo_special, custom_weapon, aimbot, infinite_ammo, always_full_ammo, infinite_mag, increased_damage, increase_damage, set_explosion_radius, modify_explosion_radius, no_recoil, no_spread, vehicle_gun_model, increased_c4_limit, increased_flare_limit, rapid_fire, gravity_gun, paintgun, interior_weapon, triggerbot, infinite_range, enable_weapon_hotkeys, weapon_hotkeys)
|
||||
} weapons{};
|
||||
|
||||
struct window
|
||||
|
@ -69,6 +69,7 @@ namespace big
|
||||
components::command_checkbox<"noragdoll">();
|
||||
components::command_checkbox<"fastrun">();
|
||||
components::command_checkbox<"noidlekick">();
|
||||
components::command_checkbox<"interactionmenufreedom">();
|
||||
components::command_checkbox<"walkunder">();
|
||||
if (!g.self.super_jump)
|
||||
components::command_checkbox<"beastjump">();
|
||||
|
@ -121,6 +121,9 @@ namespace big
|
||||
components::command_checkbox<"incrdamage">();
|
||||
ImGui::InputFloat("VIEW_WEAPON_DAMAGE"_T.data(), &g.weapons.increased_damage, .1, 10, "%.1f");
|
||||
|
||||
components::command_checkbox<"modifyexplosionradius">();
|
||||
ImGui::InputFloat("VIEW_WEAPON_EXPLOSION_RADIUS"_T.data(), &g.weapons.set_explosion_radius, .1, 200, "%.1f");
|
||||
|
||||
ImGui::SeparatorText("CUSTOM_WEAPONS"_T.data());
|
||||
|
||||
ImGui::Checkbox("VIEW_WEAPON_CUSTOM_GUN_ONLY_FIRES_WHEN_THE_WEAPON_IS_OUT"_T.data(), &g.self.custom_weapon_stop);
|
||||
|
Loading…
Reference in New Issue
Block a user