
/* 
* AMX Mod script. 
* This file is provided as is (no warranties). 
* 
* Automatic Map-Restart after xx Seconds 
*  by ToT|V!PER (viper@totclan.de) 
* 
* Homepage: http://www.totclan.de 
* IRC-Chan: #totclan @ irc.de.quakenet.org 
* 
* ------------------------------------------------ 
* 
* Changelog: 
* 
* V0.5 : First Public Release 
* 
* ------------------------------------------------ 
* 
* Put in server.cfg: 
* 
* autorestart_mode < value > 
* autorestart_mode 1 = Enable Plugin (default) 
* autorestart_mode 0 = Disable Plugin 
* 
* autorestart_time < float > 
* autorestart_time 5.0 = Restart after 5 Seconds 
* 
*/   

#include <amxmod> 

public restart_time() 
   set_task (get_cvar_float("autorestart_time"),"restart_map",0) 

public restart_map() {  
   if (get_cvar_float("autorestart_mode")){ 
      set_hudmessage(0, 100, 200, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, 2)   
      show_hudmessage(0,"[AMX] Automatic Round-Restart!")  
      log_message("[AMX] (Auto-Restart) - Round restarted after mapchange")  
      set_cvar_float("sv_restart",5.0) 
   } 
   else { 
      client_print(0,print_chat,"[AMX] Autorestart plugin is disabled. No restart will be done!")    
   } 
} 

public plugin_init() { 
   register_plugin("Auto-Restart","0.5","viper@totclan.de") 
   register_event("TextMsg","restart_time","a","2&#Game_C") 
   register_cvar("autorestart_mode","1") 
   register_cvar("autorestart_time","5.0") 
   return PLUGIN_CONTINUE   
} 

