[ANY] Bullet Penetration Filter (1.3)
2 Attachment(s)
Bullet Penetration Filter
Version 1.3 (final) Table of Contents ---------------------------------------------------- Description Commands and Cvars Installation Dependencies Changelog Notes Download Description ---------------------------------------------------- Allows server administrators to define bullet penetration rules. Bullets are prevented from penetrating certain entities. Commands and Cvars ---------------------------------------------------- Cvars sm_penetration_version Plugin version. sm_penetration_players (Default 1) Determines which players bullets can penetrate (0 - any players, 1 - only enemies, 2 - only teammates, 3 - no players) sm_penetration_geometry (Default 1) Determines whether bullets can penetrate geometry and props (0 - no penetration, 1 - regular penetration) Installation ---------------------------------------------------- Place bulletpenetrationfilter.smx into the server's /addons/sourcemod/plugins/ directory. Dependencies ---------------------------------------------------- SDKHooks must be installed. Changelog ----------------------------------------------------
Spoiler
Notes ---------------------------------------------------- -The rationale of the plugin is to prevent players from shooting through their teammates when FF is off. This negates the cheap tactic of using your teammates as human shields. Download ---------------------------------------------------- |
Re: [ANY] Bullet Penetration Filter (1.0)
Interesting method! It appears that it would be fairly trivial to also add support in for blocking damage for bullets that have penetrated corners of buildings or thin walls, if you were interested. Also, OnTakeDamage needs only to be hooked once within OnClientPutInServer.
|
Re: [ANY] Bullet Penetration Filter (1.0)
Quote:
|
Re: [ANY] Bullet Penetration Filter (1.0)
Quote:
|
Re: [ANY] Bullet Penetration Filter (1.0)
Quote:
|
Re: [ANY] Bullet Penetration Filter (1.0)
Should I unhook the players OnDisconnect too?
|
Re: [ANY] Bullet Penetration Filter (1.0)
Negative, SDKHooks does this automatically.
|
Re: [CS:GO] Bullet Penetration Filter (1.1)
Thanks for the feedback, I did what you guys suggested and uploaded it as "oldbulletpenetrationfilter.sp". Unfortunately the traceray solution had a couple problems which I couldn't remedy, one of which being that if the first player to be shot died, the traceray wouldn't be able to detect them and would think the second player was not being hit by a penetrating bullet. The second issue was that it was impossible to deal with bullet spread.
When I started thinking about how to fix the first problem, I realized my solution didn't need tracerays at all. So here you go. This solution still has problems with shotguns, though. New Version
|
Re: [CS:GO] Bullet Penetration Filter (1.1)
Just for your next update and code consistency, I suggest you put an "else" on L85, since you did put one on L94.
And the no-TR version surprises me a bit... if I got it right, OnTakeDamage is executed multiple times, for every hit player, in the order the bullet goes through, right ? Cool thing. |
Re: [CS:GO] Bullet Penetration Filter (1.2)
Quote:
HOWEVER. Completely eliminating tracerays did more harm than good. Since OnTakeDamage isn't called if players don't take damage, not using tracerays means that players who don't take damage (but are still in the way) aren't account for, such as friendlies when ff is off. And since the entire point of the plugin was to PREVENT bullets from going through friendlies, ESPECIALLY when friendly fire is off, I ended up removing the very feature I was trying to program! So I went back to the traceray method, but I still had to deal with the "disappearing obstruction", so I had to do two tracerays, one from the attacker to the victim, and another from the attacker BEYOND the victim, to see if anyone beyond the victim had the potential to get hurt by penetrating bullets. tl;dr I think I fixed the issues with the plugin. I'm still confused by the order in which damage from shotgun bullets fire, but the way I've coded it -should- account for multiple shotgun bullets penetrating, even if the player dies and those bullets intend to hit a second player. New Version
This plugin has been very trial-and-error for me. It's definitely tested and working, although it is quite difficult to thoroughly test the shotgun bullets (since there are three categories - bullets that hit player 1, bullets that hit player 2, and bullets that hit player 1 and pass through to player 2, further complicated by the fact that if player 1 dies in the process, he is no longer a traceray obstruction for player 2). I'll just have to have faith that it works as intended. |
All times are GMT -4. The time now is 20:22. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.