mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-07 09:53:50 +08:00
feat(Protections): Added cage protection
This commit is contained in:
parent
1846e64c95
commit
f47c4d13d1
@ -0,0 +1,28 @@
|
|||||||
|
#include "features.hpp"
|
||||||
|
#include "gta/replay.hpp"
|
||||||
|
#include "pointers.hpp"
|
||||||
|
|
||||||
|
namespace big
|
||||||
|
{
|
||||||
|
void features::replay_interface()
|
||||||
|
{
|
||||||
|
rage::CReplayInterface* replay_interf = *g_pointers->m_replay_interface;
|
||||||
|
rage::CObjectInterface* object_interf = replay_interf->m_object_interface;
|
||||||
|
|
||||||
|
auto& protections = g_settings.options["settings"]["protections"];
|
||||||
|
|
||||||
|
const int max_obj = object_interf->m_max_objects;
|
||||||
|
for (int i = 0; i < max_obj; i++)
|
||||||
|
{
|
||||||
|
rage::CObject* obj = object_interf->get_object(i);
|
||||||
|
if (obj == nullptr) continue;
|
||||||
|
|
||||||
|
Object ent = g_pointers->m_ptr_to_handle(obj);
|
||||||
|
|
||||||
|
if (protections["cage"] && ENTITY::GET_ENTITY_MODEL(ent) == RAGE_JOAAT("prop_gold_cont_01"))
|
||||||
|
{
|
||||||
|
functions::delete_entity(ent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -83,6 +83,21 @@ namespace big
|
|||||||
{
|
{
|
||||||
auto& protections = g_settings.options["settings"]["protections"];
|
auto& protections = g_settings.options["settings"]["protections"];
|
||||||
|
|
||||||
|
if (
|
||||||
|
ImGui::Checkbox("Cage Protection", protections["cage"].get<bool*>())// ||
|
||||||
|
//ImGui::Checkbox("Version Mismatch Protection", protections["version_mismatch"].get<bool*>())
|
||||||
|
)
|
||||||
|
g_settings.save();
|
||||||
|
|
||||||
|
ImGui::TreePop();
|
||||||
|
}
|
||||||
|
|
||||||
|
ImGui::Separator();
|
||||||
|
|
||||||
|
if (ImGui::TreeNode("Script Protection"))
|
||||||
|
{
|
||||||
|
auto& protections = g_settings.options["settings"]["script_protections"];
|
||||||
|
|
||||||
if (
|
if (
|
||||||
ImGui::Checkbox("Bounty", protections["bounty"].get<bool*>()) ||
|
ImGui::Checkbox("Bounty", protections["bounty"].get<bool*>()) ||
|
||||||
ImGui::Checkbox("Ceo Ban", protections["ceo_ban"].get<bool*>()) ||
|
ImGui::Checkbox("Ceo Ban", protections["ceo_ban"].get<bool*>()) ||
|
||||||
|
@ -125,7 +125,12 @@ namespace big
|
|||||||
|
|
||||||
main_batch.add("Replay Interface", "48 8D 0D ? ? ? ? 48 8B D7 E8 ? ? ? ? 48 8D 0D ? ? ? ? 8A D8 E8 ? ? ? ? 84 DB 75 13 48 8D 0D", [this](memory::handle ptr)
|
main_batch.add("Replay Interface", "48 8D 0D ? ? ? ? 48 8B D7 E8 ? ? ? ? 48 8D 0D ? ? ? ? 8A D8 E8 ? ? ? ? 84 DB 75 13 48 8D 0D", [this](memory::handle ptr)
|
||||||
{
|
{
|
||||||
m_replay_interface = ptr.add(3).rip().as<CReplayInterface**>();
|
m_replay_interface = ptr.add(3).rip().as<decltype(m_replay_interface)>();
|
||||||
|
});
|
||||||
|
|
||||||
|
main_batch.add("Pointer to Handle", "48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 8B 15 ? ? ? ? 48 8B F9 48 83 C1 10 33 DB", [this](memory::handle ptr)
|
||||||
|
{
|
||||||
|
m_ptr_to_handle = ptr.as<decltype(m_ptr_to_handle)>();
|
||||||
});
|
});
|
||||||
|
|
||||||
main_batch.run(memory::module(nullptr));
|
main_batch.run(memory::module(nullptr));
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
#include "gta/fwddec.hpp"
|
#include "gta/fwddec.hpp"
|
||||||
#include "gta/enums.hpp"
|
#include "gta/enums.hpp"
|
||||||
|
#include "gta/replay.hpp"
|
||||||
#include "function_types.hpp"
|
#include "function_types.hpp"
|
||||||
|
|
||||||
namespace big
|
namespace big
|
||||||
@ -19,7 +20,7 @@ namespace big
|
|||||||
|
|
||||||
CPedFactory **m_ped_factory{};
|
CPedFactory **m_ped_factory{};
|
||||||
CNetworkPlayerMgr **m_network_player_mgr{};
|
CNetworkPlayerMgr **m_network_player_mgr{};
|
||||||
CReplayInterface **m_replay_interface{};
|
rage::CReplayInterface **m_replay_interface{};
|
||||||
|
|
||||||
rage::scrNativeRegistrationTable *m_native_registration_table{};
|
rage::scrNativeRegistrationTable *m_native_registration_table{};
|
||||||
functions::get_native_handler_t m_get_native_handler{};
|
functions::get_native_handler_t m_get_native_handler{};
|
||||||
@ -46,6 +47,8 @@ namespace big
|
|||||||
functions::spectate_player* m_spectate_player{};
|
functions::spectate_player* m_spectate_player{};
|
||||||
functions::sync_local_time* m_sync_local_time{};
|
functions::sync_local_time* m_sync_local_time{};
|
||||||
functions::trigger_script_event* m_trigger_script_event{};
|
functions::trigger_script_event* m_trigger_script_event{};
|
||||||
|
|
||||||
|
functions::ptr_to_handle* m_ptr_to_handle{};
|
||||||
};
|
};
|
||||||
|
|
||||||
inline pointers *g_pointers{};
|
inline pointers *g_pointers{};
|
||||||
|
@ -36,7 +36,6 @@ namespace big
|
|||||||
"population_modifiers": false,
|
"population_modifiers": false,
|
||||||
"ragdoll": false,
|
"ragdoll": false,
|
||||||
"rank": 6969,
|
"rank": 6969,
|
||||||
"reveal_players": false,
|
|
||||||
"speedo_type": 0,
|
"speedo_type": 0,
|
||||||
"spoof_rank": false,
|
"spoof_rank": false,
|
||||||
"sticky_tyres": false,
|
"sticky_tyres": false,
|
||||||
@ -44,6 +43,10 @@ namespace big
|
|||||||
"vehicle_density": 1.0,
|
"vehicle_density": 1.0,
|
||||||
"settings": {
|
"settings": {
|
||||||
"protections": {
|
"protections": {
|
||||||
|
"cage": false,
|
||||||
|
"version_mismatch": false
|
||||||
|
},
|
||||||
|
"script_protections": {
|
||||||
"bounty": false,
|
"bounty": false,
|
||||||
"ceo_ban": false,
|
"ceo_ban": false,
|
||||||
"ceo_kick": false,
|
"ceo_kick": false,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user