Raised This Month: $ Target: $400
 0% 

Left 4 Dead (and L4D2) Anti-Camp plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author
eyeonus
Member
Join Date: Jul 2009
Plugin ID:
1097
Plugin Version:
1.4
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    6 
    Plugin Description:
    A mod to counter camping (AKA shiva stacking) in L4D versus games.
    Old 08-16-2009 , 07:10   Left 4 Dead (and L4D2) Anti-Camp plugin
    Reply With Quote #1

    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.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d_anti-camp.sp - 3300 views - 6.6 KB)

    Last edited by eyeonus; 12-31-2009 at 02:55. Reason: Updated plugin to 1.4
    eyeonus is offline
    olj
    Veteran Member
    Join Date: Jun 2009
    Old 08-16-2009 , 12:47   Re: Left 4 Dead Anti-Camp plugin
    Reply With Quote #2

    I believe Smoker Cloud damage is best anticamp system ever . Gj anyway, this can be useful in competitive matches.
    __________________
    olj is offline
    DieTeetasse
    Senior Member
    Join Date: Jul 2009
    Old 08-16-2009 , 14:17   Re: Left 4 Dead Anti-Camp plugin
    Reply With Quote #3

    I think th eplugin will output errors, if there are only 3 campers, because you check always the distances between all 4 survivors
    DieTeetasse is offline
    n0limit
    Senior Member
    Join Date: May 2009
    Old 08-16-2009 , 16:32   Re: Left 4 Dead Anti-Camp plugin
    Reply With Quote #4

    Quote:
    Originally Posted by olj View Post
    I believe Smoker Cloud damage is best anticamp system ever . Gj anyway, this can be useful in competitive matches.
    Nah, quads are
    n0limit is offline
    eyeonus
    Member
    Join Date: Jul 2009
    Old 08-17-2009 , 03:03   Re: Left 4 Dead Anti-Camp plugin
    Reply With Quote #5

    Quote:
    Originally Posted by DieTeetasse View Post
    I think th eplugin will output errors, if there are only 3 campers, because you check always the distances between all 4 survivors
    Well, my friends and I have been playing my serve with it for about a week now, and it's worked fine. It's funny when the bots get slapped too.
    I did notice one error, though. Apparently there's a memory leak somewhere. Does anyone know what's causing it?

    EDIT: I have the smoker damage one on my server too, but I don't consider it an anti-camp mod- it does almost the same thing as the anti-camp part of Die's mod, except only when they're camping in a smoker cloud. So, again, it doesn't actually make them stop camping, it just gives them a reason not to.

    Last edited by eyeonus; 08-17-2009 at 03:05.
    eyeonus is offline
    Edhmelus
    Senior Member
    Join Date: Aug 2009
    Old 08-17-2009 , 04:14   Re: Left 4 Dead Anti-Camp plugin
    Reply With Quote #6

    I like the sound of this.

    Alot at that! So! I want to know now.

    could someone probably report here if he or she or it used the plugin yet on his server and observed how it works at Mercy hospital 4 at the elevator?

    I want to know if: Shiva stacking doesnt work anymore
    I want to know if: Sitting in front of the elevator side by side doesnt work anymore.
    I want to know if: Spreading around doesnt work anymore ! E.g: One left side elevator, one right side, one in the shiva corner, one behind the one in the shiva corner near by the closet.
    I want to know if: This plugin spoils tactics that allow covering eachother a bit more close up and are tactically 100% okay.
    __________________


    Server is using Perkmod and we are in love with the Grasshopper, Toungetwister and other things.

    We are also currently recruiting (EU) people only. Going to merge with another clan soon and change from Eternal Silence.
    Edhmelus is offline
    DieTeetasse
    Senior Member
    Join Date: Jul 2009
    Old 08-17-2009 , 05:31   Re: Left 4 Dead Anti-Camp plugin
    Reply With Quote #7

    A radius of 40 means, that they have to stay almost inside each other to activate the slapping.
    An example: In DT2, where most people camp right before the barrier at the panic event, they will get slapped.

    @eyeonus: A situation. 4 survivors standing in one corner. One of them is incap. After the execution of this code:
    Code:
                if (IsValidEntity(i) && (GetClientTeam(i) == 2) && IsPlayerAlive(i) && (GetEntProp(i, Prop_Send, "m_isIncapacitated") != 1)) {
                    GetClientAbsOrigin(i, location[client]) //Get client's position.
                    z_location[client] = location[client][2] //Need to check z-distance separately.
                    location[client][2] = 0.0
                    clients[client] = i
                    client++
                }
    there will be a "3" stored in the client variable. And only the first 3 cells of the array will be filled. So, then you execute this code:
    Code:
                distance[0] = GetVectorDistance(location[0], location[1])
                z_distance[0] = FloatAbs(z_location[0]-z_location[1])
                distance[1] = GetVectorDistance(location[0], location[2])
                z_distance[1] = FloatAbs(z_location[0]-z_location[2])
                distance[2] = GetVectorDistance(location[0], location[3])
                z_distance[2] = FloatAbs(z_location[0]-z_location[3])        
                distance[3] = GetVectorDistance(location[1], location[2])            
                z_distance[3] = FloatAbs(z_location[1]-z_location[2])
                distance[4] = GetVectorDistance(location[1], location[3])
                z_distance[4] = FloatAbs(z_location[1]-z_location[3])
                distance[5] = GetVectorDistance(location[2], location[3])
                z_distance[5] = FloatAbs(z_location[2]-z_location[3])
    Theoretically there will nothing special happen, because in location[3] and z_location[3] are zeros stored, but you dont know, that on some special custom map, there is a corner right near the 0-0-0 cordinates. Then there will be an error. ;-)

    Last edited by DieTeetasse; 08-17-2009 at 05:41.
    DieTeetasse is offline
    eyeonus
    Member
    Join Date: Jul 2009
    Old 08-18-2009 , 08:10   Re: Left 4 Dead Anti-Camp plugin
    Reply With Quote #8

    Die, that code was copied almost exactly from your mod- only the names were changed. So if it might cause error on MINE, it'll cause the same error on YOURS.

    Last edited by eyeonus; 08-18-2009 at 08:22.
    eyeonus is offline
    eyeonus
    Member
    Join Date: Jul 2009
    Old 08-18-2009 , 08:55   Re: Left 4 Dead Anti-Camp plugin
    Reply With Quote #9

    Quote:
    Originally Posted by Edhmelus View Post
    I like the sound of this.

    Alot at that! So! I want to know now.

    could someone probably report here if he or she or it used the plugin yet on his server and observed how it works at Mercy hospital 4 at the elevator?
    I tested it at the NM4 bed, and it does eventually slap them out of there, however, it usually takes a few slaps.
    Quote:
    Originally Posted by Edhmelus View Post
    I want to know if: Shiva stacking doesnt work anymore
    Yes, it will slap them in such cases after the Admin defined (default 5 seconds) wait time.
    Quote:
    Originally Posted by Edhmelus View Post
    I want to know if: Sitting in front of the elevator side by side doesnt work anymore.
    If they are touching, yes, otherwise no, unless the admin for the server increases the radius.
    Quote:
    Originally Posted by Edhmelus View Post
    I want to know if: Spreading around doesnt work anymore ! E.g: One left side elevator, one right side, one in the shiva corner, one behind the one in the shiva corner near by the closet.
    No, it will not prevent this, unless the admin for the server increases the radius.
    Quote:
    Originally Posted by Edhmelus View Post
    I want to know if: This plugin spoils tactics that allow covering eachother a bit more close up and are tactically 100% okay.
    No, it will not stop this either, unless the admin for the server increases the radius.

    Increasing the radius high enough to prevent all those is not recommended, as it would probably cause the survivors to be getting slapped continuously, and no one would enjoy playing on a server like that.

    The mod only detects how close the survivors are to each other, and slaps them if they are too close for too long, it doesn't check to see if they are in a corner or not.

    Last edited by eyeonus; 08-18-2009 at 08:58.
    eyeonus is offline
    DieTeetasse
    Senior Member
    Join Date: Jul 2009
    Old 08-18-2009 , 14:50   Re: Left 4 Dead Anti-Camp plugin
    Reply With Quote #10

    Code:
    Die, that code was copied almost exactly from your mod- only the names were changed. So if it might cause error on MINE, it'll cause the same error on YOURS.
    To avoid such error, i implemented two versions. One for only 3 campers and one for all 4 survivors. Therefor no, it will not cause this error in my plugin.
    DieTeetasse 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 12:39.


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