Raised This Month: $51 Target: $400
 12% 

[TF2] Map Overdue Stalemate(v.1.0, 2014-09-18)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
DerpVulpes
Junior Member
Join Date: Dec 2013
Plugin ID:
4358
Plugin Version:
1.0
Plugin Category:
Server Management
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
    10 
    Plugin Description:
    Forces current round to end with stalemate if the map is running for too long
    Old 09-18-2014 , 11:56   [TF2] Map Overdue Stalemate(v.1.0, 2014-09-18)
    Reply With Quote #1

    This plugin still needs some testing and polishing, but it's stable enough to be released to the public.

    This plugin forces the currently running round to end with stalemate if the map is still running past its timelimit. You can set how many minutes after the timelimit stalemate should occur. Because stalemate is forced after the timelimit, server should change the map, as there's no more time for another round. If the server has the Sudden Death mode enabled (mp_stalemate_enable 1), forcing a stalemate will result with the round going into Sudden Death.

    Code for forcing the stalemate was taken from the Force End Round plugin by DarthNinja

    Before taking any action, plugin informs players about stalemate with notifications showing up every minute and announcer reading "Mission ends in...". When the stalemate is really close to occur, plugin starts the 60 second countdown, after which the round ends. If the players manage to finish the round before plugin will take no action. If the map is extended by changing the mp_timelimit or by restarting the game (even during a countdown) plugin will postpone the stalemate according to the new setting.

    CVARs:

    sm_mapoverdue_version - plugin version
    sm_mapoverdue_enabled - enables the plugin
    sm_mapoverdue_warning - how many minutes after the timelimit plugin should start showing the notifications, negative value will trigger the notifications before timelimit hits 0 (e.g. "-2" means that first warning about stalemate will show up when there's 2 minutes left for current map)
    sm_mapoverdue_stalemate - how many minutes after the timelimit to force a stalemate/sudden death

    Changelog:
    Quote:
    2014-09-18, 1.0
    Public release
    Attached Files
    File Type: sp Get Plugin or Get Source (mapoverdue.sp - 1326 views - 7.4 KB)

    Last edited by DerpVulpes; 09-21-2014 at 04:35.
    DerpVulpes is offline
    DJ Data
    SourceMod Donor
    Join Date: Dec 2012
    Location: Switzerland
    Old 12-13-2014 , 16:46   Re: [TF2] Map Overdue Stalemate(v.1.0, 2014-09-18)
    Reply With Quote #2

    Surprised there arent any comments. This is great!
    __________________
    SourcePawn Coding Level: Novice
    DJ Data is offline
    ClassicGuzzi
    Veteran Member
    Join Date: Oct 2013
    Location: Argentina
    Old 12-14-2014 , 00:32   Re: [TF2] Map Overdue Stalemate(v.1.0, 2014-09-18)
    Reply With Quote #3

    Awesome plugin!
    I have a question, not directly related to the plugin, if I have the sudden death mode activated and I use part of this code to force a stalemate in the middle of the round, then would be possible to have multiples sudden deaths?
    ClassicGuzzi is offline
    Drixevel
    AlliedModders Donor
    Join Date: Sep 2009
    Location: Somewhere headbangin'
    Old 12-14-2014 , 02:44   Re: [TF2] Map Overdue Stalemate(v.1.0, 2014-09-18)
    Reply With Quote #4

    Few tips:

    This isn't necessary but it saves lines and gives you less headaches if you ever have to precache many files at once.

    Code:
      new String:sPrecache[PLATFORM_MAX_PATH];
      for (new i = 1; i < 10; i++)
      {
        Format(sPrecache, sizeof(sPrecache), "vo/announcer_ends_%isec.wav", i);
        PrecacheSound(sPrecache);
      }
    That code will precache the 1st 10 sounds you precache in the plugin less lines. (1-10)

    ---

    You should probably check if the handle for the timer is active at the end of the map.

    Code:
    if (overdueTimer != INVALID_HANDLE)
    {
    	KillTimer(overdueTimer);
    	overdueTimer = INVALID_HANDLE;
    }
    ---

    This...

    Code:
    if (GetConVarBool(overdueEnabled) == false)
    Can be this...

    Code:
    if (!GetConVarBool(overdueEnabled))

    Just a few small things to keep the plugin clean.

    Last edited by Drixevel; 12-14-2014 at 02:46.
    Drixevel is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 12-14-2014 , 02:58   Re: [TF2] Map Overdue Stalemate(v.1.0, 2014-09-18)
    Reply With Quote #5

    Quote:
    Originally Posted by r3dw3r3w0lf View Post
    Few tips:

    This isn't necessary but it saves lines and gives you less headaches if you ever have to precache many files at once.

    Code:
      new String:sPrecache[PLATFORM_MAX_PATH];
      for (new i = 1; i < 10; i++)
      {
        Format(sPrecache, sizeof(sPrecache), "vo/announcer_ends_%isec.wav", i);
        PrecacheSound(sPrecache);
      }
    That code will precache the 1st 10 sounds you precache in the plugin less lines. (1-10)
    Or you could just skip precaching them in the first place and do either:
    A manual teamplay_broadcast_audio event. Team 0 = all players (used to be -1, but Valve "fixed" that).
    A PlayVO entity input on the tf_gamerules entity. (there are also PlayVORed and PlayVOBlue for team-specific messages)

    Oh right, first you need to know that these don't take sample names, but instead game sound names, such as "Announcer.RoundEnds60seconds"
    __________________
    Not currently working on SourceMod plugin development.

    Last edited by Powerlord; 12-14-2014 at 02:59.
    Powerlord is offline
    Reply



    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 15:10.


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