Raised This Month: $168 Target: $400
 42% 

[TF2] Melee Only - Sudden Death


Post New Thread Reply   
 
Thread Tools Display Modes
Author
pheadxdll
AlliedModders Donor
Join Date: Jun 2008
Plugin ID:
2123
Plugin Version:
0.1.1
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    4 
    Plugin Description:
    Force melee and any class during sudden death!
    Old 12-13-2010 , 13:11   [TF2] Melee Only - Sudden Death
    Reply With Quote #1

    Melee Only - Sudden Death

    Force melee and a specific class during sudden death!


    Requires this melee plugin to be installed before you start.

    Features:
    • Force melee-only sudden death with a specific class.
    • Melee only can allow non-combat weapons unlike the built-in mp_stalemate_meleeonly.
    Convars:
    • melee_suddendeath - (default 1) - 0/1 - Enable or disable this plugin.
    • melee_suddendeath_class - (default "heavy") - Force a class during sudden death. Leave blank to disable. Acceptable values: scout, soldier, pyro, demo/demoman, heavy, engineer/engy, medic, sniper, spy, random.
    • melee_suddendeath_chance - (default 1.0) - Set a chance to enable this mode during suddendeath. Between 0.0 - 1.0: 0.5 = 50% 0.75 = 75% 1.0 = 100% (always on).
    Changelog:
    Code:
    0.1.1 - Added a check to see if the plugin is enabled before changing mp_stalemate_enable
    0.1 - Initial Release.
    Install instructions:
    1. Make sure you have this melee plugin installed.
    2. melee_suddendeath.smx goes in sourcemod/plugins

    Make suggestions, always looking for features to improve on.
    Attached Files
    File Type: smx melee_suddendeath.smx (5.0 KB, 617 views)
    File Type: sp Get Plugin or Get Source (melee_suddendeath.sp - 306 views - 3.6 KB)
    __________________

    Last edited by pheadxdll; 08-19-2011 at 12:20.
    pheadxdll is offline
    alinayg
    Senior Member
    Join Date: Apr 2009
    Location: USA, RI
    Old 12-18-2010 , 20:40   Re: [TF2] Melee Only - Sudden Death
    Reply With Quote #2

    Was this one updated since the Christmas patch? Cuz it seems to have stopped working.
    __________________

    Last edited by alinayg; 12-18-2010 at 21:13.
    alinayg is offline
    pheadxdll
    AlliedModders Donor
    Join Date: Jun 2008
    Old 01-04-2011 , 21:37   Re: [TF2] Melee Only - Sudden Death
    Reply With Quote #3

    Yeah, at first I was puzzled when I went to try it, but I noticed that the default setting is off. People will probably install this if they want to use it, so I set the default to on and class as heavy. I did try it and it works fine!
    __________________
    pheadxdll is offline
    Leonardo
    Veteran Member
    Join Date: Feb 2010
    Location: Soviet Union
    Old 01-05-2011 , 05:48   Re: [TF2] Melee Only - Sudden Death
    Reply With Quote #4

    Quote:
    1. Make sure you have this melee plugin installed.
    link: http://[/SIZE
    fail.
    __________________
    Leonardo is offline
    pheadxdll
    AlliedModders Donor
    Join Date: Jun 2008
    Old 01-05-2011 , 09:55   Re: [TF2] Melee Only - Sudden Death
    Reply With Quote #5

    Quote:
    Originally Posted by Leonardo View Post
    link: http://[/SIZE
    fail.
    thanks for letting me know
    __________________
    pheadxdll is offline
    PharaohsPaw
    Senior Member
    Join Date: Dec 2008
    Old 02-11-2011 , 10:52   Re: [TF2] Melee Only - Sudden Death
    Reply With Quote #6

    pheadxdll,

    Thanks for making this and the melee only plugins, it is great to have a good one available again!

    In getting this set up on a couple servers I found that melee_suddendeath *always* sets mp_stalemate_enable to 1, even if you have disabled the plugin in the map-specific .cfg file. (because the cvar is changed by the plugin after server.cfg, map-specific .cfg, and sourcemod.cfg have all run).

    I've made a small patch (aside from the comments, sorry...) that places a conditional on forcing mp_stalemate_enable on, based on whether melee_suddendeath is enabled or not. If it is not enabled (say, because it's a CP map, or whatever reason the server admin doesn't want sudden death enabled in a particular map), it does not set mp_stalemate_enable to 1.

    Code:
    diff -up ./melee_suddendeath.sp.stalemate ./melee_suddendeath.sp
    --- ./melee_suddendeath.sp.stalemate    2011-02-10 17:26:23.884960150 -0500
    +++ ./melee_suddendeath.sp    2011-02-10 18:07:03.456772254 -0500
    @@ -3,7 +3,7 @@
     #include <tf2_stocks>
     #include "melee.inc"
     
    -#define PLUGIN_VERSION "0.1"
    +#define PLUGIN_VERSION "0.1-pp1"
     
     new Handle:g_hEnabled;
     new Handle:g_hClass;
    @@ -47,9 +47,35 @@ public OnMapStart()
     
     public OnConfigsExecuted()
     {
    -    new Handle:hCvar = FindConVar("mp_stalemate_enable");
    -    SetConVarInt(hCvar, 1);
    -    CloseHandle(hCvar);
    +    /* making sure mp_stalemate_enable is on is a good idea
    +     * *IF* whatever the current map is is one that you WANT
    +     * going into stalemate - this may or may not be desirable
    +     * to you or work very well on all types of maps - like cp
    +     * maps and others with their own round/mini-round timers.
    +     * Always forcing mp_stalemate_enable on, if for some reason
    +     * there happens to be an mp_timelimit in effect on the map
    +     * (perhaps because a default one is set in the global
    +     * server.cfg, etc.), can cause a cp or other type map to go
    +     * into stalemate when it is completely unexpected (going by the
    +     * round/mini-round timer at the top of the screen, not by
    +     * mp_timelimit which is otherwise ignored in many non-ctf maps).
    +     *
    +     * Since we have a plugin "enable" cvar which defines whether this
    +     * plugin is even supposed to be active or not, why not use the
    +     * value of this cvar to control whether we set mp_stalemate_enable
    +     * to 1 or not?  This way we get per-map configurability (via the
    +     * map-specific .cfg file) of not only whether we want sudden death
    +     * melee behavior on this map, but also whether we want
    +     * mp_stalemate_enable enabled AT ALL.  Otherwise mp_stalemate_enable
    +     * will *ALWAYS* be set on if this plugin is loaded, even when the
    +     * map-specific .cfg file explicitly turns it off!
    +     */
    +    if (GetConVarInt(g_hEnabled) == 1)
    +    {
    +        new Handle:hCvar = FindConVar("mp_stalemate_enable");
    +        SetConVarInt(hCvar, 1);
    +        CloseHandle(hCvar);
    +    }
     }
     
     
    @@ -132,4 +158,4 @@ public Action:Event_SuddenDeathEnd(Handl
         }
         
         return Plugin_Continue;
    -}
    \ No newline at end of file
    +}

    The patch is also attached as a file, and the melee_suddendeath.sp file attached is a version with this patch already in it.

    (If you agree this is useful or a good idea, feel free to discard all the comments haha)

    Cheers,
    PharaohsPaw
    Attached Files
    File Type: patch melee-suddendeath-0.1-dont-always-force-stalemate-enable.patch (2.2 KB, 121 views)
    File Type: sp Get Plugin or Get Source (melee_suddendeath.sp - 122 views - 4.9 KB)
    PharaohsPaw is offline
    alinayg
    Senior Member
    Join Date: Apr 2009
    Location: USA, RI
    Old 07-29-2011 , 22:25   Re: [TF2] Melee Only - Sudden Death
    Reply With Quote #7

    I still get crashes when sudden death happens. already updated the gamedata for the base plugin.
    __________________
    alinayg is offline
    walker29
    Junior Member
    Join Date: May 2011
    Old 08-19-2011 , 11:48   Re: [TF2] Melee Only - Sudden Death
    Reply With Quote #8

    It says failed to compile when trying to download.
    walker29 is offline
    pheadxdll
    AlliedModders Donor
    Join Date: Jun 2008
    Old 08-19-2011 , 12:22   Re: [TF2] Melee Only - Sudden Death
    Reply With Quote #9

    Quote:
    Originally Posted by walker29 View Post
    It says failed to compile when trying to download.
    Grab the .smx one, it doesn't compile on the forum because of the melee include. I've gone ahead and made Pharaohs' changes. Thx!
    __________________
    pheadxdll is offline
    walker29
    Junior Member
    Join Date: May 2011
    Old 08-19-2011 , 13:21   Re: [TF2] Melee Only - Sudden Death
    Reply With Quote #10

    Thank you, Is it possible you could make a command to force sudden death, even when in the middle of a round for some fun, On a 24/7 map server, the time has no limit and it's not possible, I'm sure people would enjoy everyone going heavy melee.
    walker29 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 16:10.


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