Description:
This plugin will save the map your server is on to a data file, and reload that map when the server restarts for any reason (for example, after a crash).
Installation:
1) Upload crashmap.smx to addons/sourcemod/plugins/
2) Restart your server (Important!)
3) Edit cfg/sourcemod/plugin.crashmap.cfg to your needs
Cvars:
sm_crashmap_enabled - Enables (1-Default) or Disables (0) the plugin. Note that if disabled, map names will not be stored
sm_crashmap_recovertime - Enables (1) or Disables (0-Default) the ability to recover the timelimit of the server.
sm_crashmap_interval - Time interval (in seconds) between updates of timeleft. (Default 20, min 1)
sm_crashmap_maxrestarts - Number of restarts that can happen before the default map is loaded. (Default 5, min 3)
sm_crashmap_version - Shows the version
Notes:
A little about how sm_crashmap_maxrestarts works:
Every time the map is recovered after a crash, the # of restarts goes up. Once it's higher than sm_crashmap_maxrestarts, the server will stay on the default map (set in the command line). If your default map crashes, that's something YOU should fix.
There are 2 ways for the # of restarts to be reset:
1) A player successfully connects to the server after a recovery
2) The max restarts limit is reached, and the default map is loaded
Changelog:
Code:
1.5
- Messages are now logged to logs/CMR.log
- crashmap.txt is now generated automatically
1.4.3
- Fixed compile warnings
- Backs up and restores nextmap on crash + recover (test feature!)
1.4.2
- Autoconfig added. cfg/sourcemod/plugin.crashmap.cfg
1.4.1
- Added FCVAR_DONTRECORD to version cvar
1.4
- Added sm_crashmap_maxrestarts
- Added support for checking if the map being changed to crashes the server
1.3
- Changed method of enabling/disabling recover time to improve performance
- Added sm_crashmap_interval
1.2
- Added timelimit recovery
- Added sm_crashmap_recovertime
1.1
- Added log message when map is recovered on restart
1.0
- Initial Release