View Single Post
Shadowysn
Senior Member
Join Date: Sep 2015
Location: Location:
Old 11-11-2019 , 06:24   Re: Passing CTakeDamageInfo to an SDKCall?
Reply With Quote #12

Quote:
Originally Posted by nosoop View Post
Yeah; that's what I figured -- DeathNotice does a lot.



It does, actually: CTFPlayer::FeignDeath() calls g_pGameRules->DeathNotice right before the call to CTFPlayer::ShouldDropAmmoPack; g_pGameRules gets dereferenced then calls it virtually (listed as call dword ptr [edx+14Ch], or a call to vtable offset 83).

A virtual gamerules SDKCall should work, theoretically.
So, something like:
PHP Code:
// GAMEDATA
"CTFGameRules::DeathNotice"
{
    
"library"    "server"
    "linux"        "@_ZN12CTFGameRules11DeathNoticeEP11CBasePlayerRK15CTakeDamageInfoPKc"
    "windows"    "\x55\x8B\x2A\x81\x2A\x2A\x2A\x2A\x2A\x53\x56\x8B\x2A\x2A\x8B\x2A\xC7\x2A\x2A\x2A\x2A\x2A\x2A"
}

// PLUGIN
StartPrepSDKCall(SDKCall_Entity);
if (!
PrepSDKCall_SetFromConf(hConfSDKConf_Signature"CTFGameRules::DeathNotice"))
{
    
SetFailState("[SM] Failed to set AC-DR CTFGameRules::DeathNotice from config!");
}
PrepSDKCall_AddParameter(SDKType_CBasePlayerSDKPass_Pointer);
PrepSDKCall_AddParameter(SDKType_PlainOldDataSDKPass_Plain);
Handle hDeathNotice EndPrepSDKCall();

int tf_gamerules FindEntityByClassname(-1"tf_gamerules");
if (
IsValidEntity(tf_gamerules))
SDKCall(hDeathNoticetf_gamerulesclient); 
...or do I have to find something in the binary again?
__________________
ragdoll spam, that is all

Steam profile, where I game, obviously.
Youtube channel, where I do Stick Death Maze animations and some other stuff.
no plugin requests, sorry


My Plugins:
-search list-
Modified Plugins:
1 | 2 | 3 | 4
Shadowysn is offline