Raised This Month: $51 Target: $400
 12% 

Hooking OnTakeDamage


Post New Thread Reply   
 
Thread Tools Display Modes
CrimsonGT
Veteran Member
Join Date: Oct 2007
Location: Gainesville, FL
Old 09-23-2009 , 00:02   Re: Hooking OnTakeDamage
Reply With Quote #21

lol yeah, same guy.

Quote:
Originally Posted by c0ldfyr3 View Post
Crimson, I'm guessing that's the knife damage extension ;) ? I incorporate it into ZM for the guy! That napalm extension screws with IPlayerInfo::GetWeaponName so I had to write a work around.

Tsunami, what's the lazy way??

And yeah, after some messing I found the problem was something else I'd changed that was messing up haha. The functions shouldn't be trusted but the variables are fine once changed to public
__________________
CrimsonGT is offline
myzombie
BANNED
Join Date: Apr 2009
Old 12-21-2009 , 23:38   Re: Hooking OnTakeDamage
Reply With Quote #22

Which means the "same" guy paid twice to get one thing done.
myzombie is offline
punisher_vip
Junior Member
Join Date: Jan 2012
Old 04-13-2013 , 15:12   Re: Hooking OnTakeDamage
Reply With Quote #23

Is there any simple solution, how to get Attacker from TakeDamage or TraceAttack hook? I cant figure out what exactly SerialNumber and EntryIndex are. This method not work for me:
Code:
int ZombiePlugin::OnTakeDamage( const CTakeDamageInfo &info )
{
	CBasePlayer *pVictim =  META_IFACEPTR( CBasePlayer );
	edict_t *pEdict = m_GameEnts->BaseEntityToEdict( pVictim );
	if ( pVictim && pEdict && !pEdict->IsFree() )
	{
		int nIndex = m_Engine->IndexOfEdict( pEdict );
		int AIndex = info.m_hAttacker.GetEntryIndex();

		if ( AIndex > 0 && AIndex <= MAX_CLIENTS ) 
		{
			pAEdict = m_Engine->PEntityOfEntIndex( AIndex  );
		}
	}
}
All the time I'm getting huge serial numbers. I also tryed to parse through all players and get theit serialnumbers/indexes, but none of them were equal to what I got. Also I tryed to get pointer from memory to g_pEntityList, but still nothing. I suppose info.m_hAttacker.GetEntryIndex(); return wrong number and whole EHANDLE shold be rewritten?
The game is CS:S

Last edited by punisher_vip; 04-13-2013 at 15:13.
punisher_vip is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 04-14-2013 , 13:37   Re: Hooking OnTakeDamage
Reply With Quote #24

As mentioned on the previous pages you need to use a custom CTakeDamageInfo that exposes attacker and inflictor like SDK Hooks has.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.

Last edited by DJ Tsunami; 04-14-2013 at 13:38.
DJ Tsunami is offline
punisher_vip
Junior Member
Join Date: Jan 2012
Old 04-18-2013 , 16:24   Re: Hooking OnTakeDamage
Reply With Quote #25

Quote:
Originally Posted by DJ Tsunami View Post
As mentioned on the previous pages you need to use a custom CTakeDamageInfo that exposes attacker and inflictor like SDK Hooks has.
Thanks! It worked.
punisher_vip is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode