feat: Fast Respawn, Rapid Fire, removed static offsets (#649)
Closes #495 Fixes #635
This commit is contained in:
parent
38c56f6532
commit
eb80ac54bd
@ -43,6 +43,7 @@ namespace big
|
||||
looped::self_unlimited_oxygen();
|
||||
looped::self_no_water_collision();
|
||||
looped::self_mobile_radio();
|
||||
looped::self_fast_respawn();
|
||||
|
||||
script::get_current()->yield();
|
||||
}
|
||||
@ -67,6 +68,7 @@ namespace big
|
||||
looped::weapons_repair_gun();
|
||||
looped::weapons_steal_vehicle_gun();
|
||||
looped::weapons_vehicle_gun();
|
||||
looped::weapons_rapid_fire();
|
||||
|
||||
script::get_current()->yield();
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ namespace big
|
||||
static void self_unlimited_oxygen();
|
||||
static void self_no_water_collision();
|
||||
static void self_mobile_radio();
|
||||
static void self_fast_respawn();
|
||||
|
||||
static void session_local_time();
|
||||
|
||||
@ -72,5 +73,6 @@ namespace big
|
||||
static void weapons_repair_gun();
|
||||
static void weapons_steal_vehicle_gun();
|
||||
static void weapons_vehicle_gun();
|
||||
static void weapons_rapid_fire();
|
||||
};
|
||||
}
|
||||
|
17
src/backend/looped/self/fast_respawn.cpp
Normal file
17
src/backend/looped/self/fast_respawn.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include "backend/looped/looped.hpp"
|
||||
#include "natives.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
void looped::self_fast_respawn()
|
||||
{
|
||||
if (g->self.fast_respawn)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
#include "backend/looped/looped.hpp"
|
||||
#include "util/water.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
@ -13,12 +12,6 @@ namespace big
|
||||
return;
|
||||
}
|
||||
|
||||
float* water_collision_ptr = nullptr;
|
||||
if (g_local_player->m_navigation != nullptr)
|
||||
{
|
||||
water_collision_ptr = water::get_water_collision_ptr(g_local_player->m_navigation);
|
||||
}
|
||||
|
||||
uint32_t bits = g->self.proof_mask;
|
||||
uint32_t changed_bits = bits ^ last_bits;
|
||||
uint32_t changed_or_enabled_bits = bits | changed_bits;
|
||||
@ -28,26 +21,6 @@ namespace big
|
||||
uint32_t unchanged_bits = g_local_player->m_damage_bits & ~changed_or_enabled_bits;
|
||||
g_local_player->m_damage_bits = unchanged_bits | bits;
|
||||
last_bits = bits;
|
||||
|
||||
|
||||
if (changed_or_enabled_bits & (uint32_t)eEntityProofs::WATER)
|
||||
{
|
||||
water::reset_ped_oxygen_time(g_local_player);
|
||||
|
||||
if (water_collision_ptr != nullptr && *water_collision_ptr != 0.f)
|
||||
{
|
||||
last_water_collistion_strength = *water_collision_ptr;
|
||||
*water_collision_ptr = 0;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (last_water_collistion_strength != 0 && water_collision_ptr != nullptr)
|
||||
{
|
||||
*water_collision_ptr = last_water_collistion_strength;
|
||||
last_water_collistion_strength = 0;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
#include "backend/looped/looped.hpp"
|
||||
#include "util/misc.hpp"
|
||||
#include "util/water.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
@ -25,12 +24,6 @@ namespace big
|
||||
g_local_player->m_vehicle->m_deform_god = 0x9C;
|
||||
}
|
||||
|
||||
float* water_collision_ptr = nullptr;
|
||||
if (g_local_player->m_vehicle->m_navigation != nullptr)
|
||||
{
|
||||
water_collision_ptr = water::get_water_collision_ptr(g_local_player->m_vehicle->m_navigation);
|
||||
}
|
||||
|
||||
uint32_t bits = g->vehicle.proof_mask;
|
||||
uint32_t changed_bits = bits ^ last_bits;
|
||||
uint32_t changed_or_enabled_bits = bits | changed_bits;
|
||||
@ -40,25 +33,6 @@ namespace big
|
||||
uint32_t unchanged_bits = g_local_player->m_vehicle->m_damage_bits & ~changed_or_enabled_bits;
|
||||
g_local_player->m_vehicle->m_damage_bits = unchanged_bits | bits;
|
||||
last_bits = bits;
|
||||
|
||||
if (changed_or_enabled_bits & (uint32_t)eEntityProofs::WATER)
|
||||
{
|
||||
water::reset_ped_oxygen_time(g_local_player);
|
||||
|
||||
if (water_collision_ptr != nullptr && *water_collision_ptr != 0.f)
|
||||
{
|
||||
last_water_collistion_strength = *water_collision_ptr;
|
||||
*water_collision_ptr = 0;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (last_water_collistion_strength != 0 && water_collision_ptr != nullptr)
|
||||
{
|
||||
*water_collision_ptr = last_water_collistion_strength;
|
||||
last_water_collistion_strength = 0;
|
||||
}
|
||||
}
|
||||
}
|
26
src/backend/looped/weapons/rapid_fire.cpp
Normal file
26
src/backend/looped/weapons/rapid_fire.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include "backend/looped/looped.hpp"
|
||||
#include "natives.hpp"
|
||||
#include "gta/enums.hpp"
|
||||
#include "util/math.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
void looped::weapons_rapid_fire()
|
||||
{
|
||||
if (g->weapons.rapid_fire)
|
||||
{
|
||||
if(!HUD::IS_PAUSE_MENU_ACTIVE())
|
||||
{
|
||||
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, (int)ControllerInputs::INPUT_ATTACK))
|
||||
{
|
||||
Vector3 direction = math::rotation_to_direction(CAM::GET_GAMEPLAY_CAM_ROT(0));
|
||||
Vector3 start = CAM::GET_GAMEPLAY_CAM_COORD() + direction;
|
||||
Vector3 end = start + direction * 200.0;
|
||||
Hash weapon_hash;
|
||||
WEAPON::GET_CURRENT_PED_WEAPON(self::ped, &weapon_hash, false);
|
||||
MISC::SHOOT_SINGLE_BULLET_BETWEEN_COORDS(start.x, start.y, start.z, end.x, end.y, end.z, WEAPON::GET_WEAPON_DAMAGE(weapon_hash, 0), true, weapon_hash, self::ped, true, false, -1.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -187,6 +187,7 @@ namespace big
|
||||
bool force_show_hud_element = false;
|
||||
bool force_show_hud = false;
|
||||
bool mobile_radio = false;
|
||||
bool fast_respawn = false;
|
||||
};
|
||||
|
||||
struct session
|
||||
@ -359,6 +360,7 @@ namespace big
|
||||
bool no_spread = false;
|
||||
char vehicle_gun_model[12] = "bus";
|
||||
bool bypass_c4_limit = false;
|
||||
bool rapid_fire = false;
|
||||
};
|
||||
|
||||
struct window
|
||||
@ -648,6 +650,7 @@ namespace big
|
||||
this->self.unlimited_oxygen = j["self"]["unlimited_oxygen"];
|
||||
this->self.no_water_collision = j["self"]["no_water_collision"];
|
||||
this->self.mobile_radio = j["self"]["mobile_radio"];
|
||||
this->self.fast_respawn = j["self"]["fast_respawn"];
|
||||
|
||||
this->session.log_chat_messages = j["session"]["log_chat_messages"];
|
||||
this->session.log_text_messages = j["session"]["log_text_messages"];
|
||||
@ -753,6 +756,7 @@ namespace big
|
||||
this->weapons.no_recoil = j["weapons"]["no_recoil"];
|
||||
this->weapons.no_spread = j["weapons"]["no_spread"];
|
||||
this->weapons.bypass_c4_limit = j["weapons"]["bypass_c4_limit"];
|
||||
this->weapons.rapid_fire = j["weapons"]["rapid_fire"];
|
||||
|
||||
this->weapons.ammo_special.type = (eAmmoSpecialType)j["weapons"]["ammo_special"]["type"];
|
||||
this->weapons.ammo_special.toggle = j["weapons"]["ammo_special"]["toggle"];
|
||||
@ -990,6 +994,7 @@ namespace big
|
||||
{ "unlimited_oxygen", this->self.unlimited_oxygen },
|
||||
{ "no_water_collision", this->self.no_water_collision },
|
||||
{ "mobile_radio", this->self.mobile_radio },
|
||||
{ "fast_respawn", this->self.fast_respawn },
|
||||
}
|
||||
},
|
||||
{
|
||||
@ -1141,6 +1146,7 @@ namespace big
|
||||
{ "no_recoil", this->weapons.no_recoil },
|
||||
{ "no_spread", this->weapons.no_spread },
|
||||
{ "bypass_c4_limit", this->weapons.bypass_c4_limit },
|
||||
{ "rapid_fire", this->weapons.rapid_fire },
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
namespace big::water
|
||||
{
|
||||
inline float* get_water_collision_ptr(CNavigation* nav)
|
||||
{
|
||||
auto nav_addr = (uint64_t)nav;
|
||||
return (float*)(*(uint64_t*)(nav_addr + 0x10) + 0x54);
|
||||
}
|
||||
|
||||
inline void reset_ped_oxygen_time(CPed* ped)
|
||||
{
|
||||
auto ped_addr = (uint64_t)ped;
|
||||
*(float*)(*(uint64_t*)(ped_addr + 0x10A0) + 0x278) = 0;
|
||||
}
|
||||
}
|
@ -56,6 +56,7 @@ namespace big
|
||||
ImGui::Checkbox("Free Cam", &g->self.free_cam);
|
||||
ImGui::Checkbox("Disable Phone", &g->tunables.disable_phone);
|
||||
ImGui::Checkbox("Unlimited Oxygen", &g->self.unlimited_oxygen);
|
||||
ImGui::Checkbox("Fast Respawn", &g->self.fast_respawn);
|
||||
|
||||
ImGui::EndGroup();
|
||||
ImGui::SameLine();
|
||||
|
@ -12,13 +12,15 @@ namespace big
|
||||
{
|
||||
void view::weapons() {
|
||||
components::sub_title("Ammo");
|
||||
|
||||
ImGui::BeginGroup();
|
||||
|
||||
ImGui::Checkbox("Infinite Ammo", &g->weapons.infinite_ammo);
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
ImGui::Checkbox("Infinite Clip", &g->weapons.infinite_mag);
|
||||
|
||||
ImGui::Checkbox("Enable Special Ammo", &g->weapons.ammo_special.toggle);
|
||||
ImGui::EndGroup();
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
||||
if (ImGui::Checkbox("Bypass C4 Limit", &g->weapons.bypass_c4_limit))
|
||||
{
|
||||
@ -27,6 +29,13 @@ namespace big
|
||||
else
|
||||
g_pointers->m_bypass_max_count_of_active_sticky_bombs->restore();
|
||||
}
|
||||
ImGui::Checkbox("Rapid Fire", &g->weapons.rapid_fire);
|
||||
|
||||
ImGui::EndGroup();
|
||||
|
||||
ImGui::Separator();
|
||||
|
||||
ImGui::Checkbox("Enable Special Ammo", &g->weapons.ammo_special.toggle);
|
||||
|
||||
eAmmoSpecialType selected_ammo = g->weapons.ammo_special.type;
|
||||
eExplosionTag selected_explosion = g->weapons.ammo_special.explosion_tag;
|
||||
|
Reference in New Issue
Block a user