Hook *Suicide = new Hook; void __cdecl Suicide_Hook(int PlayerID) { Console_Output("test\n"); } void __declspec(naked) Suicide_Glue() { __asm { mov eax, [edi+6B4h]; push eax; call Suicide_Hook; add esp, 4; pop edi; pop ecx; retn; } } Suicide5MinWait::Suicide5MinWait() { RegisterEvent(EVENT_LOAD_LEVEL_HOOK,this); RegisterEvent(EVENT_PLAYER_LEAVE_HOOK,this); Suicide->Install('\xE9', 0x004BA144, (int)&Suicide_Glue, ""); }
void __declspec(naked) Suicide_Hook() { __asm { mov eax, [ecx+6B4h] push eax call DAEventManager::Suicide_Event add esp, 4 ret } } void InitEngineDA() { DAMemoryPatcher::Install_Jump_Hook(0x004BA140,Suicide_Hook); //Hook cSuicideEvent::Act }