This isn't very well coded... try something like this:
Code:
//Server Shutdown by Remo Williams
#include <amxmodx>
#include <amxmisc>
new countdown = 10
public plugin_init()
{
register_plugin("Server Shutdown", "1.0", "Remo Williams")
register_concmd("amx_shutdown","servershutdown",ADMIN_IMMUNITY," - shuts down server in 10 seconds")
}
public servershutdown(id)
{
if (!(get_user_flags(id)&ADMIN_LEVEL_A))
{
console_print(id,"[AMXX] You have no access to this command")
return PLUGIN_HANDLED
}
client_print(0,print_chat,"***** Warning! Server Restart Imminent! *****")
set_task(1.0,"countdownact",_,_,_,"b")
return PLUGIN_HANDLED
}
public countdownact()
{
countdown--
client_print(0,print_chat,"%s seconds until server restart.",countdown)
if(countdown <= 0)
{
client_cmd(0,"retry",1.5)
server_cmd("quit")
}
return PLUGIN_HANDLED
}
__________________