AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Gnome and Cola Shove Damage [v1.1.1 | 15-January-2023] (https://forums.alliedmods.net/showthread.php?t=327647)

Marttt 10-01-2020 19:27

[L4D2] Gnome and Cola Shove Damage [v1.1.1 | 15-January-2023]
 
34 Attachment(s)
L4D2 ONLY

Description

Allows both gnome and cola to do damage when shoving. Useful for some mutation gamemodes.

Features
  • Allows configuring the damage applied.
  • Allows configuring the damage type applied.
  • Allows forcing shove action when pressing the fire (M1) button.
  • Allows removing the shove penalty while holding a gnome/cola.
  • Allows enabling friendly fire and configuring the friendly fire damage amount.
  • Allows configuring output to chat when equipped and which teams should the message be transmitted to.

Cvars

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

PHP Code:

// Allow the cola to do shove damage.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_cola_shove_dmg_allow "1"

// Alternate button for throwing the cola.
// 0 = OFF, 1 = RELOAD (R), 2 = ZOOM (M3), 3 = RELOAD (R) or ZOOM (M3).
// -
// Default: "3"
// Minimum: "0.000000"
// Maximum: "3.000000"
l4d2_cola_shove_dmg_alt_throw_button "3"

// Should the message be transmitted to those who picked up the cola.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_cola_shove_dmg_announce_self "1"

// Which teams should the message be transmitted to on cola equip.
// 0 = NONE, 1 = SURVIVOR, 2 = INFECTED, 4 = SPECTATOR, 8 = HOLDOUT.
// Add numbers greater than 0 for multiple options.
// Example: "3", enables for SURVIVOR and INFECTED.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "15.000000"
l4d2_cola_shove_dmg_announce_team "1"

// How much damage the cola does.
// -
// Default: "50"
// Minimum: "0.000000"
l4d2_cola_shove_dmg_damage "50"

// Which kind of damage type the cola does.
// Known values can be found here: https://developer.valvesoftware.com/wiki/Damage_types#Damage_type_table
// Add numbers greater than 0 for multiple options.
// Example: "136", enables DMG_CLUB and DMG_BURN.
// -
// Default: "128"
// Minimum: "0.000000"
l4d2_cola_shove_dmg_damage_type "128"

// How much friendly fire the cola does.
// 0 = OFF.
// -
// Default: "0"
// Minimum: "0.000000"
l4d2_cola_shove_dmg_ff_damage "0"

// Remove the shove penalty while holding the cola.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_cola_shove_dmg_no_shove_penalty "1"

// Force the client to shove the cola when pressing the attack button.
// Note: This prevents the cola from being thrown.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_cola_shove_dmg_shove_on_attack "1"

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

// Delay in seconds to output to the chat the message from the same client again.
// 0 = OFF.
// -
// Default: "3.0"
// Minimum: "0.000000"
l4d2_gnome_n_cola_shove_dmg_spam_protection "3.0"

// Allow the gnome to do shove damage.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_gnome_shove_dmg_allow "1"

// Alternate button for throwing the gnome.
// 0 = OFF, 1 = RELOAD (R), 2 = ZOOM (M3), 3 = RELOAD (R) or ZOOM (M3).
// -
// Default: "3"
// Minimum: "0.000000"
// Maximum: "3.000000"
l4d2_gnome_shove_dmg_alt_throw_button "3"

// Should the message be transmitted to those who picked up the gnome.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_gnome_shove_dmg_announce_self "1"

// Which teams should the message be transmitted to on gnome equip.
// 0 = NONE, 1 = SURVIVOR, 2 = INFECTED, 4 = SPECTATOR, 8 = HOLDOUT.
// Add numbers greater than 0 for multiple options.
// Example: "3", enables for SURVIVOR and INFECTED.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "15.000000"
l4d2_gnome_shove_dmg_announce_team "1"

// How much damage the gnome does.
// -
// Default: "50"
// Minimum: "0.000000"
l4d2_gnome_shove_dmg_damage "50"

// Which kind of damage type the gnome does.
// Known values can be found here: https://developer.valvesoftware.com/wiki/Damage_types#Damage_type_table
// Add numbers greater than 0 for multiple options.
// Example: "136", enables DMG_CLUB (128) and DMG_BURN (8).
// -
// Default: "128"
// Minimum: "0.000000"
l4d2_gnome_shove_dmg_damage_type "128"

// How much friendly fire the gnome does.
// 0 = OFF.
// -
// Default: "0"
// Minimum: "0.000000"
l4d2_gnome_shove_dmg_ff_damage "0"

// Remove the shove penalty while holding the gnome.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_gnome_shove_dmg_no_shove_penalty "1"

// Force the client to shove the gnome when pressing the attack button.
// Note: This prevents the gnome from being thrown.
// 0 = OFF, 1 = ON.
// -
// Default: "1"
// Minimum: "0.000000"
// Maximum: "1.000000"
l4d2_gnome_shove_dmg_shove_on_attack "1" 

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

Change Log

Spoiler


Current Translations
  • en - English
  • es - Spanish
  • pt - Brazilian Portuguese
  • pt_p - Portuguese

Known issues
  • SDK_TakeDamage bypasses OnTakeDamage.
  • Is possible to drop the cola right after picking it up by holding the FIRE button (M1), the gnome doesn't behave like this.

Notes
  • Enabling the "Shove on Attack" cvar, prevents the gnome/cola from being thrown. Press "E" to drop or use.
  • You can get a list of damage types and their values here sdkhooks.inc / Valve.

To Do
  • Better damage handling (SDK_TakeDamage bypasses OnTakeDamage).

Thank you!

Related Plugins

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

Installation
  • Put the "l4d2_gnome_n_cola_shove_dmg.phrases.txt" file in your "\addons\sourcemod\translations\" folder.
  • Put the "l4d2_gnome_n_cola_shove_dmg.smx" file (click Get Plugin) in your "\addons\sourcemod\plugins\" folder.

AlexAlcala 10-01-2020 21:25

Re: [L4D2] Gnome and Cola Shove Damage [v1.0.0 | 01-October-2020]
 
thanks for the plugin Marttt <3

TypicalType 10-02-2020 22:07

Re: [L4D2] Gnome and Cola Shove Damage [v1.0.0 | 01-October-2020]
 
friendly fire fator would be abit annoying...

HarryPotter 01-04-2021 07:10

Re: [L4D2] Gnome and Cola Shove Damage [v1.0.6 | 25-October-2020]
 
Chinese
PHP Code:


    
"Equipped a gnome"
    
{
        
"zho"            "{orange}{1} {lightgreen}裝備了 {olive}小侏儒{lightgreen}!"
        "chi"            "{orange}{1} {lightgreen}装备了 {olive}小侏儒{lightgreen}!"
    
}

    
"Equipped a cola"
    
{
        
"zho"            "{orange}{1} {lightgreen}裝備了 {olive}可樂瓶{lightgreen}!"
        "chi"            "{orange}{1} {lightgreen}装备了 {olive}可乐瓶{lightgreen}!"
    



jeremyvillanueva 01-21-2021 14:48

Re: [L4D2] Gnome and Cola Shove Damage [v1.0.7 | 04-January-2021]
 
Hi, I'm, like always, very grateful for all your work,

I love this sharing your spent time on this for the use of this community,

I would like to report this exception, that I got
with the plugin
l4d2_gnome_n_cola_shove_dmg

L 01/19/2021 - 22:23:18: [SM] Exception reported: Entity -1 (-1) is invalid
L 01/19/2021 - 22:23:18: [SM] Blaming: l4d2_gnome_n_cola_shove_dmg.smx
L 01/19/2021 - 22:23:18: [SM] Call stack trace:
L 01/19/2021 - 22:23:18: [SM] [0] GetEntProp
L 01/19/2021 - 22:23:18: [SM] [1] Line 401, /home/forums/content/files/2/9/0/3/2/7/186306.attach::OnWeaponSwitchPost

I don't really understand it, when I got time I'll look into it,

Greetings,

jeremyvillanueva 02-14-2021 23:08

Re: [L4D2] Gnome and Cola Shove Damage [v1.0.9 | 23-January-2021]
 
Thanks a lot Marttt, I studied a lot in SourcePawn and I consider that
I can help you now,

Thanks a lot for take my error, maybe the error it's from another plugin,

I'll check if it comes again, thanks again!!

Hawkins 10-29-2021 18:13

Re: [L4D2] Gnome and Cola Shove Damage [v1.0.9 | 23-January-2021]
 
For some reason i cant get it to work. I put the files where they belong. Started map. Restarted the server. Checked Server console whether the plugin is loaded, it was.
But no Gnome or Cola deals damage and .CFG file is not being created.

Marttt 05-27-2022 21:20

Re: [L4D2] Gnome and Cola Shove Damage [v1.1.0 | 27-May-2022]
 
Plugin updated. (1.1.0)

Code:

1.1.0 (27-May-2022)
    - Fixed an error while loading the plugin before map load. (thanks "Haigen" for reporting)
    - Removed check for shove penalty.



All times are GMT -4. The time now is 15:46.

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