Jump to content

ryanm2711

Members
  • Posts

    2
  • Joined

  • Last visited

 Content Type 

Profiles

Forums

Gallery

Downloads

News Articles

Modding Wiki

RDR2 Native Database

RDR2 Native Parameters

RDR2 Player Clothes Database

RDR2 Ped Voices Database

RDR2 Ped Speech Lines

RDR Modding Tutorials

RDR2 Ped Model Database

RDR2 Animations Database

RDRFR Changelog

RDRFR Installation Guide

RDRFR Features

RDRFR Settings

LML User Contributions

Everything posted by ryanm2711

  1. Hey guys I was just wondering how I would hook into the game's native functions and alter it's behaviour globally? I want to hook into the TASK_KNOCKED_OUT native and make it so the third parameter dictating whether or not the knockout is permanent to always be false - resulting in infinite knockouts on the same pedestrian, in theory. I have written the code to hook into the native, and I have got MinHook - but I couldn't find anywhere that has got information on the address for the native table which points to said function. This is my first time doing this sort of thing, so I am not particularly confident in finding it myself through disassembling, but if needed - some pointers on where to start would be appreciated 🙂 Code: #include "script.h" typedef void(*Original_TASK_KNOCKED_OUT)(Ped ped, float duration, BOOL isPermanent); Original_TASK_KNOCKED_OUT Original_TASK_KNOCKED_OUT_Func = nullptr; void Hooked_TASK_KNOCKED_OUT(Ped ped, float duration, BOOL isPermanent) { isPermanent = false; // Always wake up // Call the original function invoke<void>(0xF90427F00A495A28, ped, duration, isPermanent); } void* GetNativeFunctionAddress() { return reinterpret_cast<void*>(invoke<void*>(0x7F8C3BE3E7A910C7)); } void ReplaceNativeFunction() { // Hook the function } void main() { while (true) { WAIT(0); } } void ScriptMain() { srand(GetTickCount()); main(); }
  2. Hey guys I was just wondering how I would hook into the game's native functions and alter it's behaviour globally? I want to hook into the TASK_KNOCKED_OUT native and make it so the third parameter dictating whether or not the knockout is permanent to always be false - resulting in infinite knockouts on the same pedestrian, in theory. I have written the code to hook into the native, and I have got MinHook - but I couldn't find anywhere that has got information on the address for the native table which points to said function. This is my first time doing this sort of thing, so I am not particularly confident in finding it myself through disassembling, but if needed - some pointers on where to start would be appreciated 🙂 Code: #include "script.h" typedef void(*Original_TASK_KNOCKED_OUT)(Ped ped, float duration, BOOL isPermanent); Original_TASK_KNOCKED_OUT Original_TASK_KNOCKED_OUT_Func = nullptr; void Hooked_TASK_KNOCKED_OUT(Ped ped, float duration, BOOL isPermanent) { isPermanent = false; // Always wake up // Call the original function invoke<void>(0xF90427F00A495A28, ped, duration, isPermanent); } void* GetNativeFunctionAddress() { return reinterpret_cast<void*>(invoke<void*>(0x7F8C3BE3E7A910C7)); } void ReplaceNativeFunction() { // Hook the function } void main() { while (true) { WAIT(0); } } void ScriptMain() { srand(GetTickCount()); main(); }
×
×
  • Create New...