This is no longer supported
Use SDKHooks instead.
This extension does a PostHook on the OnTakeDamage function to create a OnTakeDamage forward.
This is different than Dukehacks in that it gives the final values, whereas Dukehacks uses a prehook and allows you to change values. This was originally written to use as a replacements for TF2's player_hurt event which provides extremely little information.
PHP Code:
forward Action:OnTakeDamage(victim, attacker, inflictor, Float:damage, damagetype);
A note about inflictor and finding the weapon used:
For instant-hit weapons, this will be the client id, and the weapon will be the one they are currently holding.
For the syringe gun and blutsauger, this will be the ent id of the weapon.
For other projectiles (flare, arrow, rocket, nade, sticky), this will be the ent id of the projectile. The weapon will be the projectile's owner.
takedamage.txt goes in /gamedata
takedamage.inc goes in /scripting/includes
takedamage.ext.* goes in /extensions (the .dll is for windows and the .so is for linux)
Source code:
http://code.google.com/p/hlstatsxcom...eDamage-extsrc
This extension was mostly written by DJ Tsunami.