View Single Post
Author Message
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 03-05-2021 , 12:47   [L4D2] Spitter Extra Projectiles [v1.0.2 | 28-July-2021]
Reply With Quote #1

L4D2 ONLY

Description

Allow spitters to spit more than a single projectile at once.

Features
  • Allow configuring the minimum spitter projectiles that a spitter should spit.
  • Allow configuring the maximum spitter projectiles and its chance that a spitter could spit.
  • Allow configuring the min/max new angles for the new spitter projectiles.
  • Allow configuring to drop a spit pool and its chance on spitter death.
  • Allow configuring which type of clients (human/bot) should be affected.

Cvars

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

PHP Code:
// Chance to create extra spit projectile with a value between "l4d2_spitter_extra_proj_min_count" and "l4d2_spitter_extra_proj_max_count" cvar value.
// 0 = OFF.
// -
// Default: "25"
// Minimum: "0.000000"
// Maximum: "100.000000"
l4d2_spitter_extra_proj_chance "25"

// Which type of client (human/bot) should be able to create additional projectiles.
// 0 = NONE, 1 = HUMAN, 2 = BOT, 3 = BOTH.
// Add numbers greater than 0 for multiple options.
// Example: "3", enables for Humans and Bots.
// -
// Default: "3"
// Minimum: "0.000000"
// Maximum: "3.000000"
l4d2_spitter_extra_proj_client_type "3"

// Chance to create a projectile inside the spitter when it dies.
// 0 = OFF.
// -
// Default: "25"
// Minimum: "0.000000"
// Maximum: "100.000000"
l4d2_spitter_extra_proj_death_chance "25"

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

// Players with these flags can create extra projectiles.
// Empty = no restriction.
// Known values at "\addons\sourcemod\configs\admin_levels.cfg".
// Example: "az", will enable extra projectiles to players with "a" (reservation) or "z" (root) flag.
// -
// Default: ""
l4d2_spitter_extra_proj_flags ""

// Maximum angles that should be added to the extra spit projectile.
// -
// Default: "60.0"
l4d2_spitter_extra_proj_max_ang "60.0"

// Maximum extra spit projectiles that could be created when a Spitter spits.
// -
// Default: "2"
// Minimum: "0.000000"
l4d2_spitter_extra_proj_max_count "2"

// Minimum angles that should be added to the extra spit projectile.
// -
// Default: "-60.0"
l4d2_spitter_extra_proj_min_ang "-60.0"

// Minimum extra spit projectiles that should be created when a Spitter spits.
// Note: It will always create this amount with a 100% chance.
// -
// Default: "1"
// Minimum: "0.000000"
l4d2_spitter_extra_proj_min_count "1" 
Related Game Cvars
  • z_spit_velocity => Spit velocity. (default: 900)

Admin Commands
  • sm_print_cvars_l4d2_spitter_extra_proj => Print the plugin related cvars and their respective values to the console. (z flag required)

Change Log

Spoiler


Notes
  • I use OnEntityCreated to detect spitter_projectile instead ability_use event, cause ability_use occurs before the projectile being created, which also returns an incorrect position for new projectiles.

Thank you!

Related Plugins

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

Requirements

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

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