This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[EXTENSION] TF2 posthook/forward for OnTakeDamage


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
psychonic

BAFFLED
Join Date: May 2008
Old 09-23-2009 , 09:53   [EXTENSION] TF2 posthook/forward for OnTakeDamage
Reply With Quote #1

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(victimattackerinflictorFloat:damagedamagetype); 
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.
Attached Files
File Type: txt takedamage.txt (153 Bytes, 619 views)
File Type: inc takedamage.inc (756 Bytes, 542 views)
File Type: dll takedamage.ext.dll (82.0 KB, 496 views)
File Type: so takedamage.ext.so (39.3 KB, 461 views)

Last edited by psychonic; 04-20-2011 at 14:23.
psychonic is offline
 



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 14:22.


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