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

[EXTENSION] TF2 posthook/forward for OnTakeDamage


Post New Thread Reply   
 
Thread Tools Display Modes
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, 613 views)
File Type: inc takedamage.inc (756 Bytes, 540 views)
File Type: dll takedamage.ext.dll (82.0 KB, 490 views)
File Type: so takedamage.ext.so (39.3 KB, 459 views)

Last edited by psychonic; 04-20-2011 at 14:23.
psychonic is offline
Onedda
Senior Member
Join Date: May 2009
Old 09-23-2009 , 11:58   Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
Reply With Quote #2

do we need the dll and so files ?
Onedda is offline
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Old 09-23-2009 , 12:08   Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
Reply With Quote #3

Yes, for windows you need the .dll and for linux the .so. You should have those in the extensions folder.

The extension will be loaded when one of your plugins use it.
pheadxdll is offline
psychonic

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

Quote:
Originally Posted by pheadxdll View Post
Yes, for windows you need the .dll and for linux the .so. You should have those in the extensions folder.

The extension will be loaded when one of your plugins use it.
I added this clarification to the first post and also some interesting notes about inflictor.
psychonic is offline
Onedda
Senior Member
Join Date: May 2009
Old 09-23-2009 , 12:40   Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
Reply With Quote #5

Thank you Psychonic and Pheadxdll
Onedda is offline
Onedda
Senior Member
Join Date: May 2009
Old 09-24-2009 , 11:33   Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
Reply With Quote #6

i did post in the HLX:CE forum as well but i am stuck with this error its making the log size well over 300meg and climbing fast

installed this today upgraded to SM 1.2.4 hg 2788.

but i am getting spammed in error log with

L 09/24/2009 - 14:039: [SM] Native "GetEntPropEnt" reported: Entity -1 is invalid
L 09/24/2009 - 14:039: [SM] Displaying call stack trace for plugin "superlogs-tf2-bow.smx":
L 09/24/2009 - 14:039: [SM] [0] Line 473, superlogs-tf2.sp::OnTakeDamage()

even with superlogs.smx

L 09/24/2009 - 16:21:45: [SM] Displaying call stack trace for plugin "superlogs-tf2.smx":
L 09/24/2009 - 16:21:45: [SM] [0] Line 473, superlogs-tf2.sp::OnTakeDamage()
L 09/24/2009 - 16:21:59: [SM] Native "GetEntPropEnt" reported: Entity -1 is invalid
Onedda is offline
psychonic

BAFFLED
Join Date: May 2008
Old 09-24-2009 , 11:46   Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
Reply With Quote #7

Quote:
Originally Posted by Onedda View Post
i did post in the HLX:CE forum as well but i am stuck with this error its making the log size well over 300meg and climbing fast

installed this today upgraded to SM 1.2.4 hg 2788.

but i am getting spammed in error log with

L 09/24/2009 - 14:039: [SM] Native "GetEntPropEnt" reported: Entity -1 is invalid
L 09/24/2009 - 14:039: [SM] Displaying call stack trace for plugin "superlogs-tf2-bow.smx":
L 09/24/2009 - 14:039: [SM] [0] Line 473, superlogs-tf2.sp::OnTakeDamage()

even with superlogs.smx

L 09/24/2009 - 16:21:45: [SM] Displaying call stack trace for plugin "superlogs-tf2.smx":
L 09/24/2009 - 16:21:45: [SM] [0] Line 473, superlogs-tf2.sp::OnTakeDamage()
L 09/24/2009 - 16:21:59: [SM] Native "GetEntPropEnt" reported: Entity -1 is invalid
That has nothing to do with this extension.
psychonic is offline
Onedda
Senior Member
Join Date: May 2009
Old 09-24-2009 , 11:48   Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
Reply With Quote #8

do you know what might be causing it Psychonic ?
Onedda is offline
psychonic

BAFFLED
Join Date: May 2008
Old 09-24-2009 , 11:58   Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
Reply With Quote #9

Quote:
Originally Posted by Onedda View Post
do you know what might be causing it Psychonic ?
It tells you in the error message
Quote:
L 09/24/2009 - 14:039: [SM] Displaying call stack trace for plugin "superlogs-tf2-bow.smx":
Download the newest version of SuperLogs: TF2 (1.3.2) that fixes the error.
psychonic is offline
Onedda
Senior Member
Join Date: May 2009
Old 09-24-2009 , 12:31   Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
Reply With Quote #10

Testing now psychonic and thank you once again
Onedda 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 00:56.


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