I spent a lot of time looking for a mod to combat camping and shiva stacking. I found
DieTeetasse's mod "
[L4D] Epicmod Lite", but it wasn't exactly what I was looking for- it had a bunch of other stuff, when all I wanted was the anti-camping, and it didn't actually STOP campers, it just hurt them for doing it.
I took the camping portion of his code, figured out how he did it, and wrote this one. The method he used to detect camping is used in my mod, but pretty much everything else is my own.
What this mod does is, once the survivors leave the safe room, it begins checking if two or more of them are occupying the same space. If it does, it warns them that in an admin specified time they will be slapped for camping. Optionally, an admin may choose to cause damage as well.
In the event that the offenders are still camping after the slap, which can happen in places like the bed by the elevator of NM4, the mod will continue to slap the offenders every half second until they are no longer camping- as such, although the admin may choose to cause up to 50 damage per slap, this is not recommended, and no damage will be caused by a slap if the slap would incapacitate the offenders- although they will still be slapped.
Incapacitated survivors are not counted as campers and will never be slapped, so it does not interfere with attempting to revive someone.
This mod also checks to make sure that the game mode is versus, and will not activate otherwise, so camping in coop and survival modes is possible.
Since version 1.4, movement checking is included- if the "camping" survivor is moving at least half the radius between checks, the slap timer is not started and no warning is issued. I
think that at the default radius, this will prevent false postives such as when two survivors are walking, crawling, or running while next to each other.
This plugin works in L4D2 as well.
CVARS:
l4d_ac_check - Generic Admin command - Activate camping check.
l4d_ac_version - Plugin version.
l4d_ac - Default 1 - Set to 0 to turn anti-camping off.
l4d_ac_warn_time - Default 5.0 - Time between warning and slap.
l4d_ac_radius - Default 30.0 - Radius for anti-camping check.
l4d_ac_slap - Default 0 - Damage to camping violators from slap.
Changelog:
1.4 - Added movement checking.
1.3 - Made warning message countdown.
1.2 - Fixed glitch where incapped/dead survivors would sometimes get slapped.
1.1 - Altered code to test survivors individually. Each now has their own, separate timer, to fix problems where some would be camping, and any others who started would not be warned, but instantly slapped.