feat: Added suggestions from #64

Added:
* Give All Weapons
* No spread
* No recoil
* Force Crosshair
* Weapon Damage Modifier
* Clean Player & Keep Player Clean
* Invisibility

Modified:
* Welcome notification shows the current hotkey to open menu
* Weapons.h has been updated with the most recent weapons
This commit is contained in:
Maddy 2022-03-02 08:48:53 -05:00 committed by GitHub
parent 8646beb059
commit 9971e8c06b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 377 additions and 16 deletions

View File

@ -34,12 +34,14 @@ namespace big
QUEUE_JOB_BEGIN_CLAUSE()
{
looped::self_clean_player();
looped::self_frame_flags();
looped::self_free_cam();
looped::self_godmode();
looped::self_invisibility();
looped::self_no_ragdoll();
looped::self_off_radar();
looped::self_police();
looped::self_no_ragdoll();
looped::self_super_run();
}QUEUE_JOB_END_CLAUSE
@ -57,12 +59,16 @@ namespace big
{
looped::weapons_cage_gun();
looped::weapons_delete_gun();
looped::weapons_force_crosshairs();
looped::weapons_gravity_gun();
looped::weapons_infinite_ammo();
looped::weapons_increased_damage();
looped::weapons_infinite_mag();
looped::weapons_no_spread();
looped::weapons_no_recoil();
looped::weapons_steal_vehicle_gun();
looped::weapons_repair_gun();
looped::weapons_vehicle_gun();
looped::weapons_infinite_ammo();
looped::weapons_infinite_mag();
}QUEUE_JOB_END_CLAUSE
QUEUE_JOB_BEGIN_CLAUSE()

View File

@ -14,13 +14,15 @@ namespace big
static void protections_replay_interface();
static void self_clean_player();
static void self_frame_flags();
static void self_free_cam();
static void self_godmode();
static void self_off_radar();
static void self_police();
static void self_invisibility();
static void self_noclip();
static void self_no_ragdoll();
static void self_off_radar();
static void self_police();
static void self_super_run();
static void system_update_players();
@ -36,11 +38,15 @@ namespace big
static void weapons_cage_gun();
static void weapons_delete_gun();
static void weapons_force_crosshairs();
static void weapons_gravity_gun();
static void weapons_increased_damage();
static void weapons_infinite_ammo();
static void weapons_infinite_mag();
static void weapons_no_recoil();
static void weapons_no_spread();
static void weapons_repair_gun();
static void weapons_steal_vehicle_gun();
static void weapons_vehicle_gun();
static void weapons_infinite_ammo();
static void weapons_infinite_mag();
};
}

View File

@ -0,0 +1,13 @@
#include "backend/looped/looped.hpp"
#include "natives.hpp"
#include "util/entity.hpp"
namespace big
{
void looped::self_clean_player()
{
if (g->self.clean_player) {
entity::clean_ped(PLAYER::PLAYER_PED_ID());
}
}
}

View File

@ -0,0 +1,19 @@
#include "backend/looped/looped.hpp"
#include "natives.hpp"
namespace big
{
static bool bLastInvisibility = false;
void looped::self_invisibility()
{
bool bInvisibility = g->self.invisibility;
if (bInvisibility || (!bInvisibility && bInvisibility != bLastInvisibility))
{
ENTITY::SET_ENTITY_VISIBLE(PLAYER::PLAYER_PED_ID(), !g->self.invisibility, 0);
bLastInvisibility = g->self.invisibility;
}
}
}

View File

@ -0,0 +1,12 @@
#include "backend/looped/looped.hpp"
#include "natives.hpp"
namespace big
{
void looped::weapons_force_crosshairs()
{
if (g->weapons.force_crosshairs) {
HUD::SHOW_HUD_COMPONENT_THIS_FRAME(14 /*RETICLE*/);
}
}
}

View File

@ -0,0 +1,16 @@
#include "backend/looped/looped.hpp"
#include "natives.hpp"
namespace big
{
void looped::weapons_increased_damage()
{
auto const player_ped = PLAYER::PLAYER_PED_ID();
if (g->weapons.increased_damage != 1) {
Hash weapon{};
WEAPON::GET_CURRENT_PED_WEAPON(player_ped, &weapon, 0);
WEAPON::SET_WEAPON_DAMAGE_MODIFIER_THIS_FRAME_(weapon, g->weapons.increased_damage);
}
}
}

View File

@ -0,0 +1,54 @@
#include "backend/looped/looped.hpp"
#include "pointers.hpp"
namespace big
{
static std::vector<std::pair<uint32_t, float>> og_recoil_values{};
static uint32_t prev_weapon_hash{};
bool is_recoil_value_cached(uint32_t hash)
{
return std::find_if(og_recoil_values.begin(), og_recoil_values.end(), [hash](auto const entry)
{
return hash == entry.first;
}) != og_recoil_values.end();
}
float get_og_recoil_value(uint32_t hash)
{
return std::find_if(og_recoil_values.begin(), og_recoil_values.end(), [hash](auto const entry)
{
return hash == entry.first;
})->second;
}
float get_recoil_value(uint32_t hash)
{
return g->weapons.no_recoil
? 0.f
: get_og_recoil_value(hash);
}
void looped::weapons_no_recoil()
{
if (!g_local_player)
{
return;
}
auto* const weapon_mgr = g_local_player->m_weapon_manager;
if (weapon_mgr)
{
auto const cur_weapon_hash = weapon_mgr->m_selected_weapon_hash;
if (prev_weapon_hash != cur_weapon_hash)
{
if (!is_recoil_value_cached(cur_weapon_hash))
{
og_recoil_values.push_back({ cur_weapon_hash, weapon_mgr->m_weapon_info->m_explosion_shake_amplitude });
}
weapon_mgr->m_weapon_info->m_explosion_shake_amplitude = get_recoil_value(cur_weapon_hash); // m_explosion_shake_amplitude is the right offset in https://github.com/Yimura/GTAV-Classes
}
}
}
}

View File

@ -0,0 +1,54 @@
#include "backend/looped/looped.hpp"
#include "pointers.hpp"
namespace big
{
static std::vector<std::pair<uint32_t, float>> og_spread_values{};
static uint32_t prev_weapon_hash{};
bool is_spread_value_cached(uint32_t hash)
{
return std::find_if(og_spread_values.begin(), og_spread_values.end(), [hash](auto const entry)
{
return hash == entry.first;
}) != og_spread_values.end();
}
float get_og_spread_value(uint32_t hash)
{
return std::find_if(og_spread_values.begin(), og_spread_values.end(), [hash](auto const entry)
{
return hash == entry.first;
})->second;
}
float get_spread_value(uint32_t hash)
{
return g->weapons.no_spread
? 0.f
: get_og_spread_value(hash);
}
void looped::weapons_no_spread()
{
if (!g_local_player)
{
return;
}
auto* const weapon_mgr = g_local_player->m_weapon_manager;
if (weapon_mgr)
{
auto const cur_weapon_hash = weapon_mgr->m_selected_weapon_hash;
if (prev_weapon_hash != cur_weapon_hash)
{
if (!is_spread_value_cached(cur_weapon_hash))
{
og_spread_values.push_back({ cur_weapon_hash, weapon_mgr->m_weapon_info->m_accuracy_spread });
}
weapon_mgr->m_weapon_info->m_accuracy_spread = get_spread_value(cur_weapon_hash);
}
}
}
}

View File

@ -63,14 +63,16 @@ namespace big
bool super_jump = false;
};
bool godmode = false;
bool clean_player = false;
bool force_wanted_level = false;
bool free_cam = false;
bool off_radar = false;
bool godmode = false;
bool invisibility = false;
bool never_wanted = false;
bool noclip = false;
bool no_ragdoll = false;
bool off_radar = false;
bool super_run = false;
bool force_wanted_level = false;
int wanted_level = 0;
frame_flags frame_flags{};
@ -119,9 +121,13 @@ namespace big
struct weapons {
CustomWeapon custom_weapon = CustomWeapon::NONE;
char vehicle_gun_model[12] = "bus";
bool force_crosshairs = false;
bool infinite_ammo = false;
bool infinite_mag = false;
float increased_damage = 1;
bool no_recoil = false;
bool no_spread = false;
char vehicle_gun_model[12] = "bus";
};
struct window {
@ -195,10 +201,12 @@ namespace big
this->tunables.disable_phone = j["tunables"]["disable_phone"];
this->tunables.no_idle_kick = j["tunables"]["no_idle_kick"];
this->self.clean_player = j["self"]["clean_player"];
this->self.godmode = j["self"]["godmode"];
this->self.off_radar = j["self"]["off_radar"];
this->self.never_wanted = j["self"]["never_wanted"];
this->self.invisibility = j["self"]["invisibility"];
this->self.no_ragdoll = j["self"]["no_ragdoll"];
this->self.never_wanted = j["self"]["never_wanted"];
this->self.off_radar = j["self"]["off_radar"];
this->self.super_run = j["self"]["super_run"];
this->self.frame_flags.explosive_ammo = j["self"]["frame_flags"]["explosive_ammo"];
@ -228,8 +236,12 @@ namespace big
this->vehicle.speedo_meter.y = j["vehicle"]["speedo_meter"]["position_y"];
this->weapons.custom_weapon = (CustomWeapon)j["weapons"]["custom_weapon"];
this->weapons.force_crosshairs = j["weapons"]["force_crosshairs"];
this->weapons.infinite_ammo = j["weapons"]["infinite_ammo"];
this->weapons.increased_damage = j["weapons"]["increased_damage"];
this->weapons.infinite_mag = j["weapons"]["infinite_mag"];
this->weapons.no_recoil = j["weapons"]["no_recoil"];
this->weapons.no_spread = j["weapons"]["no_spread"];
this->window.debug = j["window"]["debug"];
this->window.handling = j["window"]["handling"];
@ -283,10 +295,12 @@ namespace big
},
{
"self", {
{ "clean_player", this->self.clean_player },
{ "godmode", this->self.godmode },
{ "off_radar", this->self.off_radar },
{ "invisibility", this->self.invisibility },
{ "never_wanted", this->self.never_wanted },
{ "no_ragdoll", this->self.no_ragdoll },
{ "off_radar", this->self.off_radar },
{ "super_run", this->self.super_run },
{
@ -341,8 +355,12 @@ namespace big
{
"weapons", {
{ "custom_weapon", (int)this->weapons.custom_weapon },
{ "force_crosshairs", this->weapons.force_crosshairs },
{ "increased_damage", this->weapons.increased_damage },
{ "infinite_ammo", this->weapons.infinite_ammo },
{ "infinite_mag", this->weapons.infinite_mag }
{ "infinite_mag", this->weapons.infinite_mag },
{ "no_recoil", this->weapons.no_recoil },
{ "no_spread", this->weapons.no_spread }
}
},
{

View File

@ -30,6 +30,8 @@ enum WeaponHashes : Hash
WEAPON_CROWBAR = RAGE_JOAAT("WEAPON_CROWBAR"),
WEAPON_DAGGER = RAGE_JOAAT("WEAPON_DAGGER"),
WEAPON_DOUBLEACTION = RAGE_JOAAT("WEAPON_DOUBLEACTION"),
WEAPON_EMPLAUNCHER = RAGE_JOAAT("WEAPON_EMPLAUNCHER"),
WEAPON_FERTILIZERCAN = RAGE_JOAAT("WEAPON_FERTILIZERCAN"),
WEAPON_FIREEXTINGUISHER = RAGE_JOAAT("WEAPON_FIREEXTINGUISHER"),
WEAPON_FIREWORK = RAGE_JOAAT("WEAPON_FIREWORK"),
WEAPON_FLARE = RAGE_JOAAT("WEAPON_FLARE"),
@ -42,7 +44,9 @@ enum WeaponHashes : Hash
WEAPON_GUSENBERG = RAGE_JOAAT("WEAPON_GUSENBERG"),
WEAPON_HAMMER = RAGE_JOAAT("WEAPON_HAMMER"),
WEAPON_HATCHET = RAGE_JOAAT("WEAPON_HATCHET"),
WEAPON_HAZARDCAN = RAGE_JOAAT("WEAPON_HAZARDCAN"),
WEAPON_HEAVYPISTOL = RAGE_JOAAT("WEAPON_HEAVYPISTOL"),
WEAPON_HEAVYRIFLE = RAGE_JOAAT("WEAPON_HEAVYRIFLE"),
WEAPON_HEAVYSHOTGUN = RAGE_JOAAT("WEAPON_HEAVYSHOTGUN"),
WEAPON_HEAVYSNIPER = RAGE_JOAAT("WEAPON_HEAVYSNIPER"),
WEAPON_HEAVYSNIPER_MK2 = RAGE_JOAAT("WEAPON_HEAVYSNIPER_MK2"),
@ -56,6 +60,7 @@ enum WeaponHashes : Hash
WEAPON_MARKSMANRIFLE_MK2 = RAGE_JOAAT("WEAPON_MARKSMANRIFLE_MK2"),
WEAPON_MG = RAGE_JOAAT("WEAPON_MG"),
WEAPON_MICROSMG = RAGE_JOAAT("WEAPON_MICROSMG"),
WEAPON_MILITARYRIFLE = RAGE_JOAAT("WEAPON_MILITARYRIFLE"),
WEAPON_MINIGUN = RAGE_JOAAT("WEAPON_MINIGUN"),
WEAPON_MINISMG = RAGE_JOAAT("WEAPON_MINISMG"),
WEAPON_MOLOTOV = RAGE_JOAAT("WEAPON_MOLOTOV"),
@ -91,12 +96,113 @@ enum WeaponHashes : Hash
WEAPON_STINGER = RAGE_JOAAT("WEAPON_STINGER"),
WEAPON_STONE_HATCHET = RAGE_JOAAT("WEAPON_STONE_HATCHET"),
WEAPON_STUNGUN = RAGE_JOAAT("WEAPON_STUNGUN"),
WEAPON_STUNGUN_MP = RAGE_JOAAT("WEAPON_STUNGUN_MP"),
WEAPON_SWITCHBLADE = RAGE_JOAAT("WEAPON_SWITCHBLADE"),
WEAPON_UNARMED = RAGE_JOAAT("WEAPON_UNARMED"),
WEAPON_VINTAGEPISTOL = RAGE_JOAAT("WEAPON_VINTAGEPISTOL"),
WEAPON_WRENCH = RAGE_JOAAT("WEAPON_WRENCH"),
};
constexpr uint32_t weapon_list[]
{
WEAPON_ADVANCEDRIFLE,
WEAPON_APPISTOL,
WEAPON_ASSAULTRIFLE,
WEAPON_ASSAULTRIFLE_MK2,
WEAPON_ASSAULTSHOTGUN,
WEAPON_ASSAULTSMG,
WEAPON_BALL,
WEAPON_BAT,
WEAPON_BATTLEAXE,
WEAPON_BOTTLE,
WEAPON_BULLPUPRIFLE,
WEAPON_BULLPUPRIFLE_MK2,
WEAPON_BULLPUPSHOTGUN,
WEAPON_BZGAS,
WEAPON_CARBINERIFLE,
WEAPON_CARBINERIFLE_MK2,
WEAPON_COMBATMG,
WEAPON_COMBATMG_MK2,
WEAPON_COMBATPDW,
WEAPON_COMBATPISTOL,
WEAPON_COMPACTLAUNCHER,
WEAPON_COMPACTRIFLE,
WEAPON_CROWBAR,
WEAPON_DAGGER,
WEAPON_DOUBLEACTION,
WEAPON_EMPLAUNCHER,
WEAPON_FERTILIZERCAN,
WEAPON_FIREEXTINGUISHER,
WEAPON_FIREWORK,
WEAPON_FLARE,
WEAPON_FLAREGUN,
WEAPON_FLASHLIGHT,
WEAPON_GOLFCLUB,
WEAPON_GRENADE,
WEAPON_GRENADELAUNCHER,
WEAPON_GRENADELAUNCHER_SMOKE,
WEAPON_GUSENBERG,
WEAPON_HAMMER,
WEAPON_HATCHET,
WEAPON_HAZARDCAN,
WEAPON_HEAVYPISTOL,
WEAPON_HEAVYRIFLE,
WEAPON_HEAVYSHOTGUN,
WEAPON_HEAVYSNIPER,
WEAPON_HEAVYSNIPER_MK2,
WEAPON_HOMINGLAUNCHER,
WEAPON_KNIFE,
WEAPON_KNUCKLE,
WEAPON_MACHETE,
WEAPON_MACHINEPISTOL,
WEAPON_MARKSMANPISTOL,
WEAPON_MARKSMANRIFLE,
WEAPON_MARKSMANRIFLE_MK2,
WEAPON_MG,
WEAPON_MICROSMG,
WEAPON_MILITARYRIFLE,
WEAPON_MINIGUN,
WEAPON_MINISMG,
WEAPON_MOLOTOV,
WEAPON_MUSKET,
WEAPON_NIGHTSTICK,
WEAPON_PETROLCAN,
WEAPON_PIPEBOMB,
WEAPON_PISTOL,
WEAPON_PISTOL50,
WEAPON_PISTOL_MK2,
WEAPON_POOLCUE,
WEAPON_PROXMINE,
WEAPON_PUMPSHOTGUN,
WEAPON_PUMPSHOTGUN_MK2,
WEAPON_RAILGUN,
WEAPON_RAYCARBINE,
WEAPON_RAYMINIGUN,
WEAPON_RAYPISTOL,
WEAPON_REVOLVER,
WEAPON_REVOLVER_MK2,
WEAPON_RPG,
WEAPON_SAWNOFFSHOTGUN,
WEAPON_SMG,
WEAPON_SMG_MK2,
WEAPON_SMOKEGRENADE,
WEAPON_SNIPERRIFLE,
WEAPON_SNOWBALL,
WEAPON_SNSPISTOL,
WEAPON_SNSPISTOL_MK2,
WEAPON_SPECIALCARBINE,
WEAPON_SPECIALCARBINE_MK2,
WEAPON_STICKYBOMB,
WEAPON_STINGER,
WEAPON_STONE_HATCHET,
WEAPON_STUNGUN,
WEAPON_STUNGUN_MP,
WEAPON_SWITCHBLADE,
WEAPON_UNARMED,
WEAPON_VINTAGEPISTOL,
WEAPON_WRENCH,
};
enum Gadgets : Hash
{
GADGET_OBJECT = RAGE_JOAAT("OBJECT"),

View File

@ -11,7 +11,9 @@
#include "renderer.hpp"
#include "script.hpp"
#include <imgui.h>
#include "widgets/imgui_hotkey.hpp"
#include "views/view.hpp"
#include "services/notification_service.hpp"
@ -90,7 +92,7 @@ namespace big
void gui::script_init()
{
g_notification_service->push("Welcome", "Loaded YimMenu. Press INSERT to open");
g_notification_service->push("Welcome", fmt::format("Loaded YimMenu. Press {} to open", ImGui::key_names[g->settings.hotkeys.menu_toggle]));
}
void gui::script_on_tick()

View File

@ -14,6 +14,14 @@ namespace big::entity
OBJECT::CREATE_OBJECT(hash, location.x, location.y, location.z - 1.f, true, false, false);
}
inline void clean_ped(Ped ped)
{
PED::CLEAR_PED_BLOOD_DAMAGE(PLAYER::PLAYER_PED_ID());
PED::CLEAR_PED_WETNESS(PLAYER::PLAYER_PED_ID());
PED::CLEAR_PED_ENV_DIRT(PLAYER::PLAYER_PED_ID());
PED::RESET_PED_VISIBLE_DAMAGE(PLAYER::PLAYER_PED_ID());
}
inline void delete_entity(Entity ent)
{
ENTITY::DETACH_ENTITY(ent, 1, 1);

View File

@ -31,6 +31,21 @@ namespace big
ImGui::Checkbox("Super Run", &g->self.super_run);
ImGui::Checkbox("No Idle Kick", &g->tunables.no_idle_kick);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("Invisibility", &g->self.invisibility);
ImGui::Checkbox("Keep Player Clean", &g->self.clean_player);
if (ImGui::Button("Clean Player"))
{
QUEUE_JOB_BEGIN_CLAUSE()
{
entity::clean_ped(PLAYER::PLAYER_PED_ID());
}
QUEUE_JOB_END_CLAUSE
}
ImGui::EndGroup();
ImGui::TreePop();

View File

@ -1,4 +1,7 @@
#include "core/data/custom_weapons.hpp"
#include "fiber_pool.hpp"
#include "gta/Weapons.h"
#include "script.hpp"
#include "views/view.hpp"
namespace big
@ -15,6 +18,35 @@ namespace big
ImGui::TreePop();
}
if (ImGui::TreeNode("Misc"))
{
ImGui::Checkbox("Force Crosshairs", &g->weapons.force_crosshairs);
ImGui::SameLine();
ImGui::Checkbox("No Recoil", &g->weapons.no_recoil);
ImGui::SameLine();
ImGui::Checkbox("No Spread", &g->weapons.no_spread);
if (ImGui::Button("Get All Weapons"))
{
QUEUE_JOB_BEGIN_CLAUSE()
{
for (auto const& weapon : weapon_list) {
WEAPON::GIVE_DELAYED_WEAPON_TO_PED(PLAYER::PLAYER_PED_ID(), weapon, 9999, false);
}
WEAPON::GIVE_DELAYED_WEAPON_TO_PED(PLAYER::PLAYER_PED_ID(), -72657034, 0, true);
}
QUEUE_JOB_END_CLAUSE
}
ImGui::SliderFloat("Damage Multiplier", &g->weapons.increased_damage, 1.f, 10.f, "%.1f");
ImGui::TreePop();
}
if (ImGui::TreeNode("Custom Weapons"))
{
CustomWeapon selected = g->weapons.custom_weapon;