mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-17 23:07:26 +08:00
feat(ReplayInterface): Added attach protection
This commit is contained in:
parent
7a8ba780dc
commit
b777e4dc0f
@ -6,6 +6,8 @@ namespace big
|
|||||||
{
|
{
|
||||||
void features::replay_interface()
|
void features::replay_interface()
|
||||||
{
|
{
|
||||||
|
Ped player = PLAYER::PLAYER_PED_ID();
|
||||||
|
|
||||||
rage::CReplayInterface* replay_interf = *g_pointers->m_replay_interface;
|
rage::CReplayInterface* replay_interf = *g_pointers->m_replay_interface;
|
||||||
rage::CObjectInterface* object_interf = replay_interf->m_object_interface;
|
rage::CObjectInterface* object_interf = replay_interf->m_object_interface;
|
||||||
|
|
||||||
@ -19,10 +21,17 @@ namespace big
|
|||||||
|
|
||||||
Object ent = g_pointers->m_ptr_to_handle(obj);
|
Object ent = g_pointers->m_ptr_to_handle(obj);
|
||||||
|
|
||||||
|
if (
|
||||||
|
protections["attach"] &&
|
||||||
|
(
|
||||||
|
ENTITY::IS_ENTITY_ATTACHED_TO_ENTITY(player, ent) ||
|
||||||
|
ENTITY::IS_ENTITY_ATTACHED_TO_ENTITY(PED::GET_VEHICLE_PED_IS_IN(player, true), ent)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
functions::delete_entity(ent);
|
||||||
|
|
||||||
if (protections["cage"] && ENTITY::GET_ENTITY_MODEL(ent) == RAGE_JOAAT("prop_gold_cont_01"))
|
if (protections["cage"] && ENTITY::GET_ENTITY_MODEL(ent) == RAGE_JOAAT("prop_gold_cont_01"))
|
||||||
{
|
|
||||||
functions::delete_entity(ent);
|
functions::delete_entity(ent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
#include "gta/fwddec.hpp"
|
#include "gta/fwddec.hpp"
|
||||||
|
#include "gta/replay.hpp"
|
||||||
#include "gta/natives.hpp"
|
#include "gta/natives.hpp"
|
||||||
|
|
||||||
namespace big::functions
|
namespace big::functions
|
||||||
@ -19,4 +20,6 @@ namespace big::functions
|
|||||||
using spectate_player = bool(bool toggle, Ped player);
|
using spectate_player = bool(bool toggle, Ped player);
|
||||||
using sync_local_time = void(int h, int m);
|
using sync_local_time = void(int h, int m);
|
||||||
using trigger_script_event = int(bool unk0, int64_t* args, int argCount, int bitFlags);
|
using trigger_script_event = int(bool unk0, int64_t* args, int argCount, int bitFlags);
|
||||||
|
|
||||||
|
using ptr_to_handle = int(rage::CObject* a1);
|
||||||
}
|
}
|
||||||
|
@ -84,6 +84,7 @@ namespace big
|
|||||||
auto& protections = g_settings.options["settings"]["protections"];
|
auto& protections = g_settings.options["settings"]["protections"];
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
ImGui::Checkbox("Attach Protection", protections["attach"].get<bool*>()) ||
|
||||||
ImGui::Checkbox("Cage Protection", protections["cage"].get<bool*>())// ||
|
ImGui::Checkbox("Cage Protection", protections["cage"].get<bool*>())// ||
|
||||||
//ImGui::Checkbox("Version Mismatch Protection", protections["version_mismatch"].get<bool*>())
|
//ImGui::Checkbox("Version Mismatch Protection", protections["version_mismatch"].get<bool*>())
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user