mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2024-12-22 20:17:24 +08:00
Hide vehicle godmode (#3103)
This commit is contained in:
parent
db371a3911
commit
b626140916
@ -689,6 +689,7 @@ namespace big
|
||||
bool spoof_cheater = false;
|
||||
|
||||
bool spoof_hide_god = true;
|
||||
bool spoof_hide_veh_god = true;
|
||||
bool spoof_hide_spectate = true;
|
||||
|
||||
bool spoof_crew_data = false;
|
||||
@ -707,7 +708,7 @@ namespace big
|
||||
|
||||
bool voice_chat_audio = false;
|
||||
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(spoofing, hide_from_player_list, spoof_blip, blip_type, spoof_rank, rank, spoof_job_points, job_points, spoof_kd_ratio, kd_ratio, spoof_bad_sport, badsport_type, spoof_player_model, player_model, spoof_cheater, spoof_hide_god, spoof_hide_spectate, spoof_crew_data, crew_tag, rockstar_crew, square_crew_tag, spoof_session_region_type, session_region_type, spoof_session_language, session_language, spoof_session_player_count, session_player_count, spoof_session_bad_sport_status, session_bad_sport, voice_chat_audio)
|
||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(spoofing, hide_from_player_list, spoof_blip, blip_type, spoof_rank, rank, spoof_job_points, job_points, spoof_kd_ratio, kd_ratio, spoof_bad_sport, badsport_type, spoof_player_model, player_model, spoof_cheater, spoof_hide_god, spoof_hide_veh_god, spoof_hide_spectate, spoof_crew_data, crew_tag, rockstar_crew, square_crew_tag, spoof_session_region_type, session_region_type, spoof_session_language, session_language, spoof_session_player_count, session_player_count, spoof_session_bad_sport_status, session_bad_sport, voice_chat_audio)
|
||||
} spoofing{};
|
||||
|
||||
struct vehicle
|
||||
|
@ -17,6 +17,9 @@ class CBlipList;
|
||||
class TimecycleKeyframeData;
|
||||
class CTrainConfig;
|
||||
class CWeaponInfoManager;
|
||||
class CGameScriptHandlerMgr;
|
||||
class CPedFactory;
|
||||
class GtaThread;
|
||||
|
||||
namespace rage
|
||||
{
|
||||
@ -30,6 +33,7 @@ namespace rage
|
||||
class netTime;
|
||||
class rlGamerInfo;
|
||||
struct game_skeleton;
|
||||
class scrProgramTable;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@ -368,6 +372,8 @@ namespace big
|
||||
functions::can_create_vehicle m_can_create_vehicle;
|
||||
|
||||
PVOID m_format_int;
|
||||
|
||||
PVOID m_write_physical_script_game_state_data_node;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
static_assert(sizeof(gta_pointers) % 8 == 0, "Pointers are not properly aligned");
|
||||
|
@ -144,6 +144,7 @@ namespace big
|
||||
|
||||
detour_hook_helper::add<hooks::format_int>("FI", g_pointers->m_gta.m_format_int);
|
||||
|
||||
detour_hook_helper::add<hooks::write_physical_script_game_state_data_node>("WPSGSDN", g_pointers->m_gta.m_write_physical_script_game_state_data_node);
|
||||
g_hooking = this;
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,7 @@ class Network;
|
||||
class GtaThread;
|
||||
class CNetworkPlayerMgr;
|
||||
class CNetworkObjectMgr;
|
||||
class CPhysicalScriptGameStateDataNode;
|
||||
|
||||
enum class eAckCode : uint32_t;
|
||||
|
||||
@ -195,6 +196,8 @@ namespace big
|
||||
static bool can_create_vehicle();
|
||||
|
||||
static void format_int(int64_t integer_to_format, char* format_string, size_t size_always_64, bool use_commas);
|
||||
|
||||
static void write_physical_script_game_state_data_node(rage::CPhysical* this_ptr, CPhysicalScriptGameStateDataNode* node);
|
||||
};
|
||||
|
||||
class minhook_keepalive
|
||||
|
@ -0,0 +1,29 @@
|
||||
#include "hooking/hooking.hpp"
|
||||
#include "util/model_info.hpp"
|
||||
|
||||
#include <netsync/nodes/physical/CPhysicalScriptGameStateDataNode.hpp>
|
||||
|
||||
namespace big
|
||||
{
|
||||
void hooks::write_physical_script_game_state_data_node(rage::CPhysical* this_ptr, CPhysicalScriptGameStateDataNode* node)
|
||||
{
|
||||
g_hooking->get_original<hooks::write_physical_script_game_state_data_node>()(this_ptr, node);
|
||||
|
||||
auto this_vehicle = (*(CVehicle*(__fastcall**)(char*))(*((DWORD64*)this_ptr - 38) + 0xC0))((char*)this_ptr - 304);
|
||||
|
||||
if (g.spoofing.spoof_hide_veh_god && g_local_player && self::veh)
|
||||
{
|
||||
if (g_local_player->m_vehicle && g_local_player->m_vehicle == this_vehicle)
|
||||
{
|
||||
node->m_godmode = false;
|
||||
node->m_bullet_proof = false;
|
||||
node->m_fire_proof = false;
|
||||
node->m_smoke_proof = false;
|
||||
node->m_steam_proof = false;
|
||||
node->m_collision_proof = false;
|
||||
node->m_explosion_proof = false;
|
||||
node->m_melee_proof = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1773,6 +1773,15 @@ namespace big
|
||||
{
|
||||
g_pointers->m_gta.m_format_int = ptr.as<PVOID>();
|
||||
}
|
||||
},
|
||||
// Write Physical Script Game State Data Node
|
||||
{
|
||||
"WPSGSDN",
|
||||
"48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 41 56 41 57 48 83 EC 20 4C 8D B1 D0 FE",
|
||||
[](memory::handle ptr)
|
||||
{
|
||||
g_pointers->m_gta.m_write_physical_script_game_state_data_node = ptr.as<PVOID>();
|
||||
}
|
||||
}
|
||||
>(); // don't leave a trailing comma at the end
|
||||
|
||||
|
@ -85,6 +85,7 @@ namespace big
|
||||
|
||||
ImGui::SeparatorText("SPOOFING_HIDE_FEATURES"_T.data());
|
||||
ImGui::Checkbox("SPOOFING_HIDE_GOD_MODE"_T.data(), &g.spoofing.spoof_hide_god);
|
||||
ImGui::Checkbox("SPOOFING_HIDE_VEH_GOD_MODE"_T.data(), &g.spoofing.spoof_hide_veh_god);
|
||||
ImGui::Checkbox("SPOOFING_HIDE_SPECTATE"_T.data(), &g.spoofing.spoof_hide_spectate);
|
||||
|
||||
ImGui::SeparatorText("CREW"_T.data());
|
||||
|
Loading…
Reference in New Issue
Block a user