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

[ANY] Shutdown Countdown


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Plugin ID:
2518
Plugin Version:
1.6.2
Plugin Category:
Server Management
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    32 
    Plugin Description:
    Lets an admin start a countdown to a server shutdown
    Old 08-27-2011 , 18:39   [ANY] Shutdown Countdown
    Reply With Quote #1

    [ANY] Shutdown Countdown

    v1.6.2

    Description:
    Allows any admin with the ADMFLAG_RCON flag (m) to start a timer till the server will automatically shut down. The command can be overridden, and the individual commands can even be overridden differently so only RCON admins can start countdowns but CVAR admins can cancel them, or something like that. The server is shut down by the plugin simply executing "quit" in the server console when the timer expires. When the timer is started, the hint box displays "WARNING: The server will shut down in x seconds." The message is customizable via cvar. When the timer falls below a certain value (customizable by a cvar, defaults to 30), the warning will also be displayed in the center of the screen, and also printed to the server console.

    Commands:
    sm_shutdown [time] - set a shutdown timer
    sm_shutdown_confirm - confirms a timer set with sm_shutdown and begins the countdown
    sm_shutdown_cancel - cancels the timer

    Cvars:
    sm_shutdown_countdown_version - plugin version
    sm_shutdown_countdown_notify - once the timer gets below this number of seconds, it will display the countdown in both csay and hsay. Defaults to 30
    sm_shutdown_countdown_tag - allows you to change the tag displayed in command replies (defaults to "[SM]")
    sm_shutdown_countdown_beginning - the first part of the warning (defaults to "WARNING: The server will shut down in")
    sm_shutdown_countdown_end - the second part of the warning (defaults to "seconds.")
    sm_shutdown_countdown_auto_update - enables automatic updating (has no effect if Updater is not installed) (defaults to 1)

    The warning message will be displayed in the format:
    [sm_shutdown_countdown_beginning] [time remaining] [sm_shutdown_countdown_end]


    Installation:
    Put shutdowncountdown.smx into /addons/sourcemod/plugins and reboot your server or type "sm plugins load shutdowncountdown" into your console or rcon.

    Auto Update:
    Install Updater. The plugin will be autoupdated according to your Updater settings. It'll work without Updater.

    Changelog:
    • v1.6.0 (7/12/12)
      • Added option to disable automatic updating (sm_shutdown_countdown_auto_update)
    • v1.5.0 (10/25/11)
      • The warning message is now customizable via cvar
    • v1.4.0 (10/24/11)
      • Fixed an issue where the plugin would not be added to the Updater pool
    • v1.3.0 (10/23/11)
      • The plugin now uses the newer, better-supported Updater plugin
      • Added a cvar to change the tag
      • The countdown will be printed to the server console when it's below sm_shutdown_countdown_notify
    • v1.2 (10/23/11)
      • The version cvar now has an "A" appended to it if autoupdate is functioning
    • v1.1 (8/28/11)
      • Fixed an issue with multiple timers being able to be started, and now uses %N instead of GetClientName.
    • v1.0 (8/27/11)
      • Initial Release

    Download Plugin (shutdowncountdown.smx)
    View Source (shutdowncountdown.sp)
    __________________

    Last edited by Dr. McKay; 07-14-2020 at 04:16.
    Dr. McKay is offline
    KyleS
    SourceMod Plugin Approver
    Join Date: Jul 2009
    Location: Segmentation Fault.
    Old 08-27-2011 , 22:48   Re: [ANY] Shutdown Countdown
    Reply With Quote #2

    Nice plugin!

    In Command_ConfirmShutdown, you create a Timer every time the command is run. If it's run twice, the countdown cannot be canceled.

    Remember you can use %N to get the client's name if you use it as a variable. ie

    PHP Code:
    LogAction(client, -1"%N requested a server shutdown for %i seconds."clientshutdownTime); 
    Hope this helps
    PM me when the timer issue is fixed.
    KyleS is offline
    Dr. McKay
    Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
    Join Date: Aug 2011
    Location: Atlantis
    Old 08-29-2011 , 17:36   Re: [ANY] Shutdown Countdown
    Reply With Quote #3

    The plugin has been updated to 1.1 with the fixes recommended above.
    __________________
    Dr. McKay is offline
    Dr. McKay
    Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
    Join Date: Aug 2011
    Location: Atlantis
    Old 10-23-2011 , 14:35   Re: [ANY] Shutdown Countdown
    Reply With Quote #4

    Updated. The version cvar now has an "A" appended to it if autoupdate is functioning.
    __________________
    Dr. McKay is offline
    Drixevel
    AlliedModders Donor
    Join Date: Sep 2009
    Location: Somewhere headbangin'
    Old 10-23-2011 , 16:20   Re: [ANY] Shutdown Countdown
    Reply With Quote #5

    I'd like to request the ability to change the tag from "[SM]" to my own tag without editing the plugin because then the autoupdater would revert it back to it's original "[SM]" tag. If you could make a translations or a CVAR with a config, it would be nice.

    Edit: Just noticed you're using the old updater plugin, you should use this one.

    http://forums.alliedmods.net/showthread.php?p=1570806

    Last edited by Drixevel; 10-23-2011 at 16:22.
    Drixevel is offline
    Dr. McKay
    Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
    Join Date: Aug 2011
    Location: Atlantis
    Old 10-23-2011 , 16:28   Re: [ANY] Shutdown Countdown
    Reply With Quote #6

    Alright, I'll add a cvar to change tag. If I used a translations file, I might add new translations and then the updater would have to overwrite them.

    Just let me figure out how to make the new updater work... Someone ought to unapprove the old one so others don't end up using it.
    __________________
    Dr. McKay is offline
    Drixevel
    AlliedModders Donor
    Join Date: Sep 2009
    Location: Somewhere headbangin'
    Old 10-23-2011 , 16:30   Re: [ANY] Shutdown Countdown
    Reply With Quote #7

    Thanks, appreciate it.
    Drixevel is offline
    Dr. McKay
    Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
    Join Date: Aug 2011
    Location: Atlantis
    Old 10-23-2011 , 18:31   Re: [ANY] Shutdown Countdown
    Reply With Quote #8

    Updated. The plugin now uses the newer, better-supported Updater plugin, added a cvar to change the tag, and the countdown will be printed to the server console when it's below sm_shutdown_countdown_notify.
    __________________
    Dr. McKay is offline
    Dr. McKay
    Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
    Join Date: Aug 2011
    Location: Atlantis
    Old 10-24-2011 , 23:50   Re: [ANY] Shutdown Countdown
    Reply With Quote #9

    Updated to 1.4.0. Fixed an issue where the plugin wouldn't be added to the Updater pool. If you are running Updater and you want to automatically update, simply execute "sm plugins reload shutdowncountdown" followed by "sm_shutdown_forceupdate" in the console/rcon.
    __________________
    Dr. McKay is offline
    Dr. McKay
    Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
    Join Date: Aug 2011
    Location: Atlantis
    Old 10-25-2011 , 16:25   Re: [ANY] Shutdown Countdown
    Reply With Quote #10

    Lots of updates to everything lately.

    Updated to 1.5.0. The warning message is now customizable via cvar. See OP for more details.
    __________________
    Dr. McKay 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 20:58.


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