Raised This Month: $218 Target: $400
 54% 

[L4D2] Throwable Melee Weapons (1.5) [26-Jan-2020]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
AlliedModders Donor
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
6916
Plugin Version:
1.5
Plugin Category:
Gameplay
Plugin Game:
Left 4 Dead
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Allows players to throw melee weapons.
    Old 01-22-2020 , 06:32   [L4D2] Throwable Melee Weapons (1.5) [26-Jan-2020]
    Reply With Quote #1

    Related Plugins:


    About:
    • Allows players to throw melee weapons. Press the Scope / Zoom button to throw (MMB - middle mouse button).
    • Various ways to set damage, depending on weapon type and target.
    • Video demonstration - Thanks to "sonic155" for recording.



    Thanks:
    • Sev - For the request.
    • Ethan Max - For also requesting and reminding me.
    • Lux - Because why not.



    Admin Commands: (requires "z" flag)

    PHP Code:
    sm_throwable_reload // Reloads the weapons damage data config. 


    Cvars:

    Saved to l4d2_throwable_melee.cfg in your servers \cfg\sourcemod\ folder.

    PHP Code:
    // 0=Plugin off, 1=Plugin on.
    l4d2_throwable_allow "1"

    // Turn on the plugin in these game modes, separate by commas (no spaces). (Empty = all).
    l4d2_throwable_modes ""

    // Turn off the plugin in these game modes, separate by commas (no spaces). (Empty = none).
    l4d2_throwable_modes_off ""

    // Turn on the plugin in these game modes. 0=All, 1=Coop, 2=Survival, 4=Versus, 8=Scavenge. Add numbers together.
    l4d2_throwable_modes_tog "0"

    // 0=Off. 1=Changes the thrown melee weapon into a boomerang returning to the thrower when it hits something.
    l4d2_throwable_return "1"

    // Minimum speed. How fast to throw a melee weapon, affects range
    l4d2_throwable_speed "500"

    // Maximum speed. How fast to throw a melee weapon, affects range
    l4d2_throwable_speed_max "1000"

    // 0.0=Off, instant throw. Max time to get max speed. The longer players hold Zoom/Scope (MMB - middle mouse button) the faster they throw.
    l4d2_throwable_speed_time "1.0"

    // 0=Off. 1=Spin top over. 2=Spin sideways. 3=Both randomly selected. Requires gamedata.
    l4d2_throwable_spin "3"

    // Which melee weapons can be thrown: 1=Baseball Bat, 2=Cricket Bat, 4=Crowbar, 8=Frying Pan, 16=Guitar, 32=Fireaxe, 64=Golfclub, 128=Katana, 256=Knife, 512=Machete, 1024=Tonfa, 2047=All. 2048=Shield, 4096=Generic. Add numbers together.
    l4d2_throwable_types "2047"

    // Throwable Melee Weapons plugin version.
    l4d2_throwable_version 


    Changes:
    Code:
    1.5 (26-Jan-2020)
        - To fix the Tonfa not working change "l4d2_throwable_types" value to "2047".
    
        - New feature: Throw distance - the longer you hold Zoom before releasing the further you throw. Requested by "MasterMind420".
        - Added cvar "l4d2_throwable_speed_max" to set a maximum throwing speed when holding MMB. Minimum speed set by "l4d2_throwable_speed".
        - Added cvar "l4d2_throwable_speed_time" to scale the throwing speed, how long the key must be held to reach maximum speed when letting go.
        - Changed cvar "l4d2_throwable_types" value to "2047" to include the missing Frying Pan option.
        - Boomerang type now verifies the players weapon slot is empty before equipping.
        - Optimized throwing event CPU cycles by validating weapon in WeaponSwitch.
        - Removed all commented out reference code.
    
    1.4 (25-Jan-2020)
        - Fixed incorrect Linux gamedata signature causing crashing.
        - Fixed the "l4d2_throwable_types" cvar using the wrong index.
        - Fixed the Baseball Bat not working.
        - Fixed the Golfclub not playing any sounds.
        - Fixed the Tank not taking damage.
        - Fixed truncating damage values with 4 numbers to 3.
        - Fixed hitting when the melee is not moving or potentially not always hitting.
        - Fixed hitting yourself.
        - Removed TraceRay.
    
    1.3 (24-Jan-2020)
        - Added cvar "l4d2_throwable_return" to enable a boomerang effect and return the weapon to thrower.
        - Added support for "Riot Shield" melee type and "Generic" - any 3rd party melee weapon.
        - Riot Shield requires extra scripts to enable, I do not support. You're on your own.
        - Data config changed to add the new types.
        - Changed from using max health cvars to reading the entities "m_iMaxHealth" value.
        - Fixed incorrect percentage calculation when using the "hits" damage type.
        - Replaced index numbers with enums for easier source readability.
    
    1.2 (24-Jan-2020)
        - Added TraceRay to hit zombies directly in front of player. Thanks to "Lux" for suggesting.
        - Replaced optional VPhysics extension with gamedata method. Thanks to "BHaType" for suggesting.
        - Cvar "l4d2_throwable_spin" uses this method and requires the optional gamedata file.
        - Fixed damage not crediting the owner.
    
    1.1 (22-Jan-2020)
        - Added correct data config.
        - Changed plugin to point to correct config.
        - Changed plugin to remove VPhysics extension for now, since optional is not working.
    
    1.0 (22-Jan-2019)
        - Initial release.


    Installation:
    1. Click "Get Plugin" and put the .smx file into your servers \addons\sourcemod\plugins\ folder.
    2. Download the "l4d_throwable_melee.cfg" config file and put into your servers \addons\sourcemod\data\ folder.
    3. Optional: download the "l4d_throwable_melee.txt" gamedata file and put into your servers \addons\sourcemod\gamedata\ folder.


    Updating from 1.4 or older:
    • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.
    Attached Files
    File Type: cfg l4d2_throwable_melee.cfg (1.1 KB, 119 views)
    File Type: txt l4d2_throwable_melee.txt (606 Bytes, 102 views)
    File Type: sp Get Plugin or Get Source (l4d2_throwable_melee.sp - 158 views - 29.3 KB)
    __________________

    Last edited by Silvers; 02-03-2020 at 15:40.
    Silvers is offline
    login101
    Senior Member
    Join Date: Sep 2017
    Old 01-22-2020 , 07:48   Re: [L4D2] Throwable Melee Weapons (1.0) [22-Jan-2020]
    Reply With Quote #2

    good!!!
    login101 is offline
    login101
    Senior Member
    Join Date: Sep 2017
    Old 01-22-2020 , 08:06   Re: [L4D2] Throwable Melee Weapons (1.0) [22-Jan-2020]
    Reply With Quote #3

    It doesn't work bug?
    login101 is offline
    xZk
    Senior Member
    Join Date: Nov 2017
    Old 01-22-2020 , 11:51   Re: [L4D2] Throwable Melee Weapons (1.0) [22-Jan-2020]
    Reply With Quote #4

    Nice idea!, but for the moment i think this is only works with the extension VPhysics Extension.
    pd: "l4d_throwable_melee.cfg" is missing
    xZk is offline
    Silvers
    AlliedModders Donor
    Join Date: Aug 2010
    Location: SpaceX
    Old 01-22-2020 , 14:56   Re: [L4D2] Throwable Melee Weapons (1.0) [22-Jan-2020]
    Reply With Quote #5

    Quote:
    Originally Posted by login101 View Post
    good!!!
    Quote:
    Originally Posted by login101 View Post
    It doesn't work bug?
    Please use edit button instead of spamming threads with replies.

    Quote:
    Originally Posted by xZk View Post
    Nice idea!, but for the moment i think this is only works with the extension VPhysics Extension.
    pd: "l4d_throwable_melee.cfg" is missing
    Oops yeah uploaded correct config, removed VPhysics for now because nothing I try makes it optional or work.
    __________________
    Silvers is offline
    BHaType
    Great Tester of Whatever
    Join Date: Jun 2018
    Location: Methamphetamine
    Old 01-22-2020 , 22:01   Re: [L4D2] Throwable Melee Weapons (1.1) [22-Jan-2020]
    Reply With Quote #6

    You can use signature to change angular velocity (melee spin)

    PHP Code:
    CBaseEntity::ApplyLocalAngularVelocityImpulse(CBaseEntity *this, const Vector *)
    @
    _ZN11CBaseEntity32ApplyLocalAngularVelocityImpulseERK6Vector 
    __________________
    Heart
    BHaType is offline
    Send a message via AIM to BHaType
    AK978
    Senior Member
    Join Date: Jun 2018
    Old 01-22-2020 , 23:07   Re: [L4D2] Throwable Melee Weapons (1.1) [22-Jan-2020]
    Reply With Quote #7

    Need to perform configuration to start?
    Weapon does not spin on attack.
    Is it possible to strengthen offensive capabilities?
    Whether to kill all zombies on the attack line.

    Last edited by AK978; 01-22-2020 at 23:09.
    AK978 is offline
    Spirit_12
    Veteran Member
    Join Date: Dec 2012
    Location: Toronto, CA
    Old 01-22-2020 , 23:59   Re: [L4D2] Throwable Melee Weapons (1.1) [22-Jan-2020]
    Reply With Quote #8

    Quote:
    Originally Posted by Silvers View Post
    Cvars:

    Saved to l4d_tongue_damage.cfg in your servers \cfg\sourcemod\ folder.
    PHP Code:
    AutoExecConfig(true,                "l4d2_throwable_melee"); 
    Kids this is why you shouldn't drink when you are scripting plugins.
    __________________
    Spirit_12 is offline
    mathilde
    Member
    Join Date: Jan 2020
    Location: samedi et dimanche
    Old 01-23-2020 , 08:23   Re: [L4D2] Throwable Melee Weapons (1.1) [22-Jan-2020]
    Reply With Quote #9

    Can I throw the shield? Cuz it's crap in game
    (Edit: Throwable shields that decapitate.)

    Last edited by mathilde; 01-23-2020 at 08:26.
    mathilde is offline
    Firebred
    Junior Member
    Join Date: Oct 2019
    Old 01-23-2020 , 10:04   Re: [L4D2] Throwable Melee Weapons (1.1) [22-Jan-2020]
    Reply With Quote #10

    Is there a possibility for the melee to automatically return back to the player after a short time after it had been thrown? Like a boomerang.
    Firebred 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 14:37.


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