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

Make an ent that stops bullets


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stupok
Veteran Member
Join Date: Feb 2006
Old 07-17-2009 , 04:55   Make an ent that stops bullets
Reply With Quote #1

Goal:
Create an ent that takes damage. When you shoot the ent, the bullet stops. So, you cannot shoot through the ent and hit players or other ents behind it.


Right now I'm making an ent and hooking Ham_TraceAttack on info_target, but messing with the trace result doesn't do anything.

Help plz. I'm probably overlooking a nice pretty way to do this. I'm not using pev_takedamage, maybe I should do that?


EDIT: I found joaquimandrade's method here: http://forums.alliedmods.net/showthread.php?t=94742

I don't like it because you need to hook so many hams just to stop a bullet. Share your ideas.
__________________

Last edited by stupok; 07-17-2009 at 05:03.
stupok is offline
stupok
Veteran Member
Join Date: Feb 2006
Old 07-17-2009 , 23:07   Re: Make an ent that stops bullets
Reply With Quote #2

I actually figured out how to solve this, so I'll describe my solution. If you want real code, I can do that upon request.

In the traceattack function, do an additional trace from the start to the TR_vecEndPos and check if you hit something other than the victim. If you do, then check if it's the ent that should be bulletproof. If it is, then supercede this call.
__________________
stupok 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 08:45.


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