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

[L4D2] Gnome and Cola Shove Damage [v1.1.1 | 15-January-2023]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Plugin ID:
7315
Plugin Version:
1.1.1
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
    4 
    Plugin Description:
    Allows both gnome and cola to do damage when shoving
    Old 10-01-2020 , 19:27   [L4D2] Gnome and Cola Shove Damage [v1.1.1 | 15-January-2023]
    Reply With Quote #1

    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.
    Attached Files
    File Type: txt l4d2_gnome_n_cola_shove_dmg.phrases.txt (1.8 KB, 148 views)
    File Type: sp Get Plugin or Get Source (l4d2_gnome_n_cola_shove_dmg.sp - 269 views - 35.2 KB)
    __________________

    Last edited by Marttt; 01-15-2023 at 12:18.
    Marttt is offline
    AlexAlcala
    Member
    Join Date: May 2019
    Location: Perú
    Old 10-01-2020 , 21:25   Re: [L4D2] Gnome and Cola Shove Damage [v1.0.0 | 01-October-2020]
    Reply With Quote #2

    thanks for the plugin Marttt <3
    AlexAlcala is offline
    TypicalType
    Member
    Join Date: Mar 2020
    Location: Brazil
    Old 10-02-2020 , 22:07   Re: [L4D2] Gnome and Cola Shove Damage [v1.0.0 | 01-October-2020]
    Reply With Quote #3

    friendly fire fator would be abit annoying...
    TypicalType is offline
    HarryPotter
    Veteran Member
    Join Date: Sep 2017
    Location: Taiwan, Asia
    Old 01-04-2021 , 07:10   Re: [L4D2] Gnome and Cola Shove Damage [v1.0.6 | 25-October-2020]
    Reply With Quote #4

    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}!"
        

    __________________
    HarryPotter is offline
    jeremyvillanueva
    AlliedModders Donor
    Join Date: Jan 2021
    Location: dcord:Jeremy333#7632
    Old 01-21-2021 , 14:48   Re: [L4D2] Gnome and Cola Shove Damage [v1.0.7 | 04-January-2021]
    Reply With Quote #5

    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 is offline
    jeremyvillanueva
    AlliedModders Donor
    Join Date: Jan 2021
    Location: dcord:Jeremy333#7632
    Old 02-14-2021 , 23:08   Re: [L4D2] Gnome and Cola Shove Damage [v1.0.9 | 23-January-2021]
    Reply With Quote #6

    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!!
    jeremyvillanueva is offline
    Hawkins
    Senior Member
    Join Date: Jul 2021
    Old 10-29-2021 , 18:13   Re: [L4D2] Gnome and Cola Shove Damage [v1.0.9 | 23-January-2021]
    Reply With Quote #7

    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.
    Hawkins is offline
    Marttt
    Veteran Member
    Join Date: Jan 2019
    Location: Brazil
    Old 05-27-2022 , 21:20   Re: [L4D2] Gnome and Cola Shove Damage [v1.1.0 | 27-May-2022]
    Reply With Quote #8

    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.
    __________________

    Last edited by Marttt; 05-27-2022 at 21:21.
    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 07:36.


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