Raised This Month: $ Target: $400
 0% 

[TF2] How to hook hitting a building?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nosoop
Veteran Member
Join Date: Aug 2014
Old 04-27-2016 , 19:22   Re: [TF2] How to hook hitting a building?
Reply With Quote #1

You could also try hooking CBaseObject::OnWrenchHit(CTFPlayer*, CTFWrench*, Vector) via DHooks.

Edit: If you're asking about any instance of damage (and not just when an Engineer hits another player's building, SDKHook_OnTakeDamage should work. See the old Hitsounds for Buildings plugin.
__________________
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)

Last edited by nosoop; 04-27-2016 at 23:33.
nosoop is offline
Blinx
Senior Member
Join Date: Oct 2013
Old 04-28-2016 , 10:11   Re: [TF2] How to hook hitting a building?
Reply With Quote #2

Huh, that plugin does seem to register ontakedamage for entities, I guess I'll explore that a bit more then, in my testing though, I couldn't get any response for ontakedamage when hitting a friendly building, maybe it's because it's not taking any damage?

Edit: Yes, that's what's happening, OnTakeDamage does work for buildings, but obviously, a friendly building doesn't take damage, so I need to find a a way to feign damage on friendly buildings.

Edit Edit @Chaosxk: I didn't give your idea much merit at first but it's actually by far the best way to achieve this without doing some team owner tomfoolery, thanks for this, my plugin is almost working now.

Last edited by Blinx; 04-28-2016 at 17:35.
Blinx 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 21:08.


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