mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-03 16:13:36 +08:00
feat(Entity): Patch Request Control of Entity
This commit is contained in:
parent
7a99637cec
commit
4746754fb8
@ -159,6 +159,13 @@ namespace big
|
||||
m_send_event_ack = ptr.sub(5).as<decltype(m_send_event_ack)>();
|
||||
});
|
||||
// Received Event Signatures END
|
||||
|
||||
main_batch.add("Request Control Of Entity", "48 89 5C 24 ? 57 48 83 EC 20 8B D9 E8 ? ? ? ? 84 C0", [this](memory::handle ptr)
|
||||
{
|
||||
PVOID spectator_check = ptr.add(0x11).as<PVOID>();
|
||||
|
||||
memset(spectator_check, 0x90, 0x4);
|
||||
});
|
||||
|
||||
main_batch.run(memory::module(nullptr));
|
||||
|
||||
|
@ -51,13 +51,9 @@ namespace big::entity
|
||||
if (NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent)) return true;
|
||||
for (uint8_t i = 0; !NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent) && i < 5; i++)
|
||||
{
|
||||
bool in_spectator = NETWORK::NETWORK_IS_IN_SPECTATOR_MODE();
|
||||
if (in_spectator) NETWORK::NETWORK_SET_IN_SPECTATOR_MODE(0, PLAYER::PLAYER_PED_ID());
|
||||
|
||||
NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(ent);
|
||||
|
||||
if (in_spectator) NETWORK::NETWORK_SET_IN_SPECTATOR_MODE(1, PLAYER::PLAYER_PED_ID());
|
||||
|
||||
script::get_current()->yield();
|
||||
}
|
||||
if (!NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent)) return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user