View Single Post
Author Message
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
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 - 342 views - 21.0 KB)
__________________

Last edited by Marttt; 01-15-2023 at 12:18.
Marttt is offline