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

Solved [L4D2]How detect direct impact of a projectile?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Old 12-28-2019 , 10:08   [L4D2]How detect direct impact of a projectile?
Reply With Quote #1

I would like to know what method I could detect when the grenade launcher hits a tank directly. I have tried to do it by checking the values of the hit group and hit box, with the events: player_hurt, OnTakeDamage / OnTraceAttack, and there is no difference between the values, when the projectile directly impacts the tank or the floor ... :/
example impact projectile
plugin test

Last edited by xZk; 01-01-2020 at 22:30.
xZk is offline
xerox8521
Senior Member
Join Date: Sep 2011
Old 12-28-2019 , 11:12   Re: [L4D2]How detect direct impact of a projectile?
Reply With Quote #2

You could hook the OnTouch with SDKHook when the grenade_launcher_projectile spawns (OnEntityCreated) and then check inside the OnTouch callback if it hit the tank.
xerox8521 is offline
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Old 01-01-2020 , 22:30   Re: [L4D2]How detect direct impact of a projectile?
Reply With Quote #3

Thanks this is works, although I would like to be able to detect this more precise projectile, such as the head shot :/
xZk is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 01-02-2020 , 14:04   Re: [L4D2]How detect direct impact of a projectile?
Reply With Quote #4

Perhaps, get "mouth" attachment point position of tank.
Check distance between that point and end touch point of grenade.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 01-02-2020 , 18:18   Re: [L4D2]How detect direct impact of a projectile?
Reply With Quote #5

Look up pipe bomb shove by Silver. It may have what you looking for.

https://forums.alliedmods.net/showthread.php?p=1733534
__________________
Spirit_12 is offline
xZk
Senior Member
Join Date: Nov 2017
Location: cl
Old 01-04-2020 , 13:47   Re: [L4D2]How detect direct impact of a projectile?
Reply With Quote #6

Thanks a lot, with your suggestions this was more than resolved
xZk is offline
Reply


Thread Tools
Display Modes

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 09:49.


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