Raised This Month: $32 Target: $400
 8% 

[L4D1 & L4D2] Gascan Invulnerable [v1.0.8 | 23-September-2021]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Plugin ID:
7352
Plugin Version:
1.0.8
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    1033 
    Plugin Description:
    Turns gascan invulnerable to certain damages types
    Old 10-26-2020 , 17:36   [L4D1 & L4D2] Gascan Invulnerable [v1.0.8 | 23-September-2021]
    Reply With Quote #1

    Description

    This plugin turns gascans invulnerable from the damages types below (most common ones):
    • Any - All damage types
    • Generic - DMG_GENERIC (no type)
    • Shove - DMG_CLUB + inflictor = valid client index
    • Melee - DMG_SLASH or DMG_CLUB
    • Bullet - DMG_BULLET
    • Fire (fire in general, molotov, incendiary ammo) - DMG_BURN
    • Blast (explosions in general, pipe bomb, explosive ammo, propane canister, oxygen tank) - DMG_BLAST
    • Chainsaw (L4D2 only) - DMG_DISSOLVE
    • Spit (L4D2 only) - DMG_ENERGYBEAM

    Useful to prevent griefers from messing up with gascans, especially in finales or stripper modified maps.

    Also useful for survival games before the clock starts, where gascans can explode while shoving.

    For L4D2 it's enabled by default only for scavenge gascans, but you can change it to normal gascans through the l4d_gascan_invul_scavenge_only cvar.

    For L4D1 it's enabled only for normal gascans, since there is no scavenge gascans in the L4D1 game.

    Features
    • Allow configuring which gascans should be invulnerable. (Normal / Scavenge [L4D2 only])
    • Allow configuring which types of damage are allowed to explode the gascan.
    • Allow configuring the distance to be invulnerable.
    • Allow configuring which gascans type should be invulnerable.
    • Allow setting the gascan health.

    Cvars

    A configuration file named "l4d_gascan_invul.cfg" will automatically be created for you upon the first run in the "\cfg\sourcemod\" folder.

    PHP Code:
    // Turn gascans invulnerable to any damage. (regardless of the damage type)
    // 0 = OFF, 1 = ON.
    // -
    // Default: "0"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_gascan_invul_any_damage "0"

    // Turn gascans invulnerable to blast damage. (DMG_BLAST)
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_gascan_invul_blast_damage "1"

    // Turn gascans invulnerable to bullet damage. (DMG_BULLET)
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_gascan_invul_bullet_damage "1"

    // Turn gascans invulnerable to chainsaw damage. (DMG_DISSOLVE)
    // L4D2 only.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_gascan_invul_chainsaw_damage "1"

    // How far the gascan should be to be invulnerable.
    // 0 = OFF.
    // -
    // Default: "0.0"
    // Minimum: "0.000000"
    l4d_gascan_invul_distance "0.0"

    // Enable/Disable the plugin.
    // 0 = Disable, 1 = Enable.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_gascan_invul_enable "1"

    // Turn gascans invulnerable to fire damage. (DMG_BURN)
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_gascan_invul_fire_damage "1"

    // Turn gascans invulnerable to generic damage. (DMG_GENERIC)
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_gascan_invul_generic_damage "1"

    // Override normal gascan health.
    // 0 = OFF.
    // Default game value = 20.
    // -
    // Default: "0"
    // Minimum: "0.000000"
    l4d_gascan_invul_health "0"

    // Turn gascans invulnerable to melee damage. (DMG_SLASH or DMG_CLUB)
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_gascan_invul_melee_damage "1"

    // Override scavenge gascan health.
    // L4D2 only.
    // 0 = OFF.
    // Default game value = 20
    // -
    // Default: "0"
    // Minimum: "0.000000"
    l4d_gascan_invul_scavenge_health "0"

    // Apply invulnerability only to scavenge gascans.
    // L4D2 only.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_gascan_invul_scavenge_only "1"

    // Turn gascans invulnerable to shove damage. (DMG_CLUB and inflictor = valid client index)
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_gascan_invul_shove_damage "1"

    // Turn gascans invulnerable to spit damage. (DMG_ENERGYBEAM)
    // L4D2 and scavenge gascan only.
    // 0 = OFF, 1 = ON.
    // -
    // Default: "1"
    // Minimum: "0.000000"
    // Maximum: "1.000000"
    l4d_gascan_invul_spit_damage "1" 
    Admin Commands
    • sm_print_cvars_l4d_gascan_invul => Print the plugin related cvars and their respective values to the console. (z flag required)

    Change Log

    Spoiler


    Notes
    • If no damage type allowed is detected, the plugin ignores any damage [damage = 0] (depends on the cvars). It also blocks the damage type DMG_BURN (ignite) and DMG_ENERGYBEAM (spit) which can trigger the gascan to explode.
    • In L4D2 survival mode seems that you can break the gascan while shoving, before the clock starts. This plugin also blocks that with the melee cvar.
    • The method used to identify if is a scavenge gascan is by checking its skin. If it's greater than 0 (default), the plugin understands that is a scavenge gascan. (L4D2 only)
    • Since there is no scavenge gascan on L4D1, it only applies to normal gascans.
    • Chainsaw damage only applies to L4D2.
    • Spit damage only applies to L4D2.

    To Do
    • Add option to only make invulnerable gascans already picked up.
    • Add option to only make invulnerable gascans by detecting if the scavenge event started.

    Thank you!

    Related Plugins

    Post Reply
    • Any feedback, bug reports, fixes, improvements, translations or suggestions for the plugin are welcome.

    Installation
    • Put the "l4d_gascan_invul.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.
    Attached Files
    File Type: sp Get Plugin or Get Source (l4d_gascan_invul.sp - 321 views - 21.0 KB)
    __________________

    Last edited by Marttt; 01-15-2023 at 12:18.
    Marttt is offline
    Psyk0tik
    Veteran Member
    Join Date: May 2012
    Location: Homeless
    Old 10-26-2020 , 17:56   Re: [L4D1 & L4D2] Gascan Invulnerable
    Reply With Quote #2

    Nice work!

    What about invulnerability to bullet damage? I've seen many players who like to shoot gas cans so that the rest of the team has to keep waiting for them to respawn. In my opinion, this is the most annoying type of gas can griefing because anyone can shoot gas cans from any distance.
    __________________
    Psyk0tik is offline
    Marttt
    Veteran Member
    Join Date: Jan 2019
    Location: Brazil
    Old 10-26-2020 , 18:12   Re: [L4D1 & L4D2] Gascan Invulnerable
    Reply With Quote #3

    Thanks for the feedback Crasher,

    Probably I need to make it more clear on description and cvars.

    I didn't make a specific cvar for bullet because other types of damages can also make the gascan break.
    __________________

    Last edited by Marttt; 04-12-2021 at 07:37.
    Marttt is offline
    Psyk0tik
    Veteran Member
    Join Date: May 2012
    Location: Homeless
    Old 10-26-2020 , 18:58   Re: [L4D1 & L4D2] Gascan Invulnerable
    Reply With Quote #4

    Alright, that makes more sense.
    __________________
    Psyk0tik is offline
    Tank Rush
    Senior Member
    Join Date: May 2019
    Location: Argentina
    Old 10-26-2020 , 20:05   Re: [L4D1 & L4D2] Gascan Invulnerable [v1.0.1 | 26-October-2020]
    Reply With Quote #5

    I will test this on my server
    Good job!
    __________________
    Sorry i don't speak english very well

    --->My name is Source and I'm on Steam<---
    Discord: Source#9382
    Tank Rush is offline
    cravenge
    Veteran Member
    Join Date: Nov 2015
    Location: Chocolate Factory
    Old 11-05-2020 , 08:10   Re: [L4D1 & L4D2] Gascan Invulnerable [v1.0.1 | 26-October-2020]
    Reply With Quote #6

    I'm liking this so far. Only enabled the invulnerability function against bullets and melees cuz of realism.

    Might I add a suggestion? Squeeze in an exception for the bullet case and by that, I mean putting a distance check between the gas can and the player.

    Speaking realistically, it would make sense that said gas can would only be ignited from far away (let's say... 1.25k or 1.5k game units) due to air friction.

    Last edited by cravenge; 01-14-2021 at 07:31.
    cravenge is offline
    ur5efj
    Member
    Join Date: Jan 2006
    Old 01-02-2021 , 03:06   Re: [L4D1 & L4D2] Gascan Invulnerable [v1.0.3 | 31-December-2020]
    Reply With Quote #7

    v1.0.3
    sourcemod-1.10.0-git6497
    Code:
    L 01/02/2021 - 02:39:24: SourceMod error session started
    L 01/02/2021 - 02:39:24: Info (map "c2m2_fairgrounds") (file "C:\SteamCMD\SteamApps\common\Left 4 Dead 2 Dedicated Server\left4dead2\addons\sourcemod\logs\errors_20210102.log")
    L 01/02/2021 - 02:39:24: [SM] Exception reported: Invalid memory access
    L 01/02/2021 - 02:39:24: [SM] Blaming: l4d_gascan_invul.smx
    L 01/02/2021 - 02:39:24: [SM] Call stack trace:
    L 01/02/2021 - 02:39:24: [SM]   [1] Line 265, l4d_gascan_invul.sp::OnEntityCreated
    L 01/02/2021 - 02:46:11: Error log file session closed.
    All previous version no error logs.
    ur5efj is offline
    Forgetest
    Member
    Join Date: Aug 2020
    Old 04-10-2021 , 15:19   Re: [L4D1 & L4D2] Gascan Invulnerable [v1.0.6 | 26-January-2021]
    Reply With Quote #8

    Hi bro, big thanks to your great job. Still, I met with some questions when using it.
    May I request for a feature and add some suggestions?

    Feature: Make it toggle-able that player can shove gascans that already picked up. Seems essential in Scavenge games. (Perhaps you can handle those gascans via hooking event "item_pickup")

    Suggestions: Shove / Blast damages come along with its forces. Indeed, pipebomb can still blow gascans far away. While shoves cannot move them, they can push gascans down, have the potential to raise unexpected results.

    ;)
    Forgetest is offline
    Tonblader
    Senior Member
    Join Date: Jul 2011
    Location: Peru
    Old 04-10-2021 , 21:47   Re: [L4D1 & L4D2] Gascan Invulnerable [v1.0.6 | 26-January-2021]
    Reply With Quote #9

    Quote:
    Originally Posted by Forgetest View Post
    Suggestions: Shove / Blast damages come along with its forces. Indeed, pipebomb can still blow gascans far away. While shoves cannot move them, they can push gascans down, have the potential to raise unexpected results.
    I would also like them to have protection against all kinds of forces (explosion, tank, collision, etc.) so that the cans do not fly all over the map (that can pushed only by survivor shove).

    Or maybe the best post to request this, is in this one:
    [L4D1 & L4D2] Remove Weapons/Carryables Collision
    Tonblader is offline
    Marttt
    Veteran Member
    Join Date: Jan 2019
    Location: Brazil
    Old 04-11-2021 , 08:44   Re: [L4D1 & L4D2] Gascan Invulnerable [v1.0.7 | 11-April-2021]
    Reply With Quote #10

    @Forgetest, thanks for reporting.

    The plugin wasn't supposed to block the force applied on shove.
    Seems that block the event also removes the force (damageForce).
    Fixed in the new version (1.0.7).

    About the item moving from blast damage, pipe bomb explosions, etc try the plugin that @Tonblader mentioned. (also made by me)
    The only "downside" is that it disables motion to all items (not only gascans)
    __________________

    Last edited by Marttt; 09-23-2021 at 22:37.
    Marttt 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 06:47.


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