
/* AMX Mod script. 
* 
* (c) Copyright 2002-2003, f117bomb 
* This file is provided as is (no warranties). 
*/ 

#include <amxmodx> 
#include <amxmisc> 
#include <engine>

/* 
* amx_rr <restart times> <delay>
*
*/ 

public drestart(param[]) 
	set_cvar_string("sv_restart",param)

public admin_rr(id, level, cid) { 
	if (!cmd_access(id, level, cid, 3))
		return PLUGIN_HANDLED
	new sdelay[4], stimes[4]
	read_argv(1,stimes,3)
	read_argv(2,sdelay,3)
	new delay = str_to_num(sdelay)
	new times = str_to_num(stimes)
	for(new a = times;a > 0;--a)
		set_task( float(delay * a) + 1.0 , "drestart", 0, sdelay, 4)
	console_print(id,"The Game will restart %d times with a %d sec. delay between restarts",times,delay)
	return PLUGIN_HANDLED 
}

public plugin_init() { 
	register_plugin("Admin RestartRound","0.9.2","f117bomb") 
	register_concmd("amx_rr","admin_rr",ADMIN_LEVEL_A,"<restart times> <delay>")
	return PLUGIN_CONTINUE 
}

