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

[TF2] Hook Damage dealt to a building


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lugui
Senior Member
Join Date: Feb 2016
Location: GetClientAbsOrigin();
Old 07-07-2017 , 22:13   [TF2] Hook Damage dealt to a building
Reply With Quote #1

I think that isn't a SDK Event, but is there a way to get the amout of damage and the attacker of a building?
lugui is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 07-08-2017 , 00:42   Re: [TF2] Hook Damage dealt to a building
Reply With Quote #2

Hitsounds for Buildings should be able to do this.
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)
nosoop is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 07-08-2017 , 08:08   Re: [TF2] Hook Damage dealt to a building
Reply With Quote #3

SDKHook_OnTakeDamageAlive

Try that.
__________________
Benoist3012 is offline
lugui
Senior Member
Join Date: Feb 2016
Location: GetClientAbsOrigin();
Old 07-08-2017 , 14:08   Re: [TF2] Hook Damage dealt to a building
Reply With Quote #4

Quote:
Originally Posted by Benoist3012 View Post
SDKHook_OnTakeDamageAlive

Try that.

I tested whith this:
PHP Code:
public Action:OnTakeDamageAlive(clientdmg){
    
    
char name[255];
    
    
GetClientName(clientname255);
    
PrintToChatAll("%s: %d "namedmg);
    
    return 
Plugin_Continue;

It gets the corect player ID (thi victm), but what is the second argument? it always print a number and it does not print anything when I hit a building.

I want to know who is the attacker and how much damage.

Thank you

Last edited by lugui; 07-08-2017 at 14:09.
lugui is offline
Benoist3012
Veteran Member
Join Date: Mar 2014
Location: CWave::ForceFinish()
Old 07-08-2017 , 15:18   Re: [TF2] Hook Damage dealt to a building
Reply With Quote #5

Quote:
Originally Posted by lugui View Post
I tested whith this:
PHP Code:
public Action:OnTakeDamageAlive(clientdmg){
    
    
char name[255];
    
    
GetClientName(clientname255);
    
PrintToChatAll("%s: %d "namedmg);
    
    return 
Plugin_Continue;

It gets the corect player ID (thi victm), but what is the second argument? it always print a number and it does not print anything when I hit a building.

I want to know who is the attacker and how much damage.

Thank you
You are doing it wrong.

Code:
void SomeFunction() {     SDKHook(iDispenser, SDKHook_OnTakeDamageAlive, Hook_BuildingOnTakeDamage); } public Action Hook_BuildingOnTakeDamage(int iBuilding, int &iAttacker, int &iInflictor, float &flDamage, int &iDamagetype, int &iWeapon, float flDamageForce[3], float vecDamagePosition[3], int iDamagecustom) { }
__________________
Benoist3012 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 07:04.


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