AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [ANY] Shutdown Countdown (https://forums.alliedmods.net/showthread.php?t=165840)

Dr. McKay 08-27-2011 18:39

[ANY] Shutdown Countdown
 
[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)

KyleS 08-27-2011 22:48

Re: [ANY] Shutdown Countdown
 
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 :P
PM me when the timer issue is fixed.

Dr. McKay 08-29-2011 17:36

Re: [ANY] Shutdown Countdown
 
The plugin has been updated to 1.1 with the fixes recommended above.

Dr. McKay 10-23-2011 14:35

Re: [ANY] Shutdown Countdown
 
Updated. The version cvar now has an "A" appended to it if autoupdate is functioning.

Drixevel 10-23-2011 16:20

Re: [ANY] Shutdown Countdown
 
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

Dr. McKay 10-23-2011 16:28

Re: [ANY] Shutdown Countdown
 
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.

Drixevel 10-23-2011 16:30

Re: [ANY] Shutdown Countdown
 
Thanks, appreciate it.

Dr. McKay 10-23-2011 18:31

Re: [ANY] Shutdown Countdown
 
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 10-24-2011 23:50

Re: [ANY] Shutdown Countdown
 
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 10-25-2011 16:25

Re: [ANY] Shutdown Countdown
 
Lots of updates to everything lately. :)

Updated to 1.5.0. The warning message is now customizable via cvar. See OP for more details.


All times are GMT -4. The time now is 03:38.

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