AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   [EXTENSION] TF2 posthook/forward for OnTakeDamage (https://forums.alliedmods.net/showthread.php?t=104430)

psychonic 09-23-2009 09:53

[EXTENSION] TF2 posthook/forward for OnTakeDamage
 
4 Attachment(s)
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.

Onedda 09-23-2009 11:58

Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
 
do we need the dll and so files ?

pheadxdll 09-23-2009 12:08

Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
 
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.

psychonic 09-23-2009 12:35

Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
 
Quote:

Originally Posted by pheadxdll (Post 941497)
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.

Onedda 09-23-2009 12:40

Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
 
Thank you Psychonic and Pheadxdll

Onedda 09-24-2009 11:33

Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
 
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:03:39: [SM] Native "GetEntPropEnt" reported: Entity -1 is invalid
L 09/24/2009 - 14:03:39: [SM] Displaying call stack trace for plugin "superlogs-tf2-bow.smx":
L 09/24/2009 - 14:03:39: [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

psychonic 09-24-2009 11:46

Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
 
Quote:

Originally Posted by Onedda (Post 942270)
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:03:39: [SM] Native "GetEntPropEnt" reported: Entity -1 is invalid
L 09/24/2009 - 14:03:39: [SM] Displaying call stack trace for plugin "superlogs-tf2-bow.smx":
L 09/24/2009 - 14:03:39: [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.

Onedda 09-24-2009 11:48

Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
 
do you know what might be causing it Psychonic ?

psychonic 09-24-2009 11:58

Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
 
Quote:

Originally Posted by Onedda (Post 942286)
do you know what might be causing it Psychonic ?

It tells you in the error message
Quote:

L 09/24/2009 - 14:03:39: [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.

Onedda 09-24-2009 12:31

Re: [EXTENSION] TF2 posthook/forward for OnTakeDamage
 
Testing now psychonic and thank you once again


All times are GMT -4. The time now is 20:42.

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