Restart the game when players have join game.
Code:
#include <amxmodx>
/*
* Auto Restart Ver1.0
* by p00h
* http://p00h.web.infoseek.co.jp
*/
new b_restart = true;
public plugin_init() {
register_plugin("Auto Restart", "1.0", "p00h");
return PLUGIN_HANDLED;
}
public client_putinserver(id) {
if(get_playersnum() > 1 && b_restart) {
set_task(30.0, "restart_round");
client_print(0, print_chat, ">> Wait for restarting . . .");
b_restart = false;
}
return PLUGIN_CONTINUE;
}
public client_disconnect(id) {
if(get_playersnum() < 2) {
b_restart = true;
}
return PLUGIN_HANDLED;
}
public restart_round() {
server_print("[AMXX] restart this game!!");
client_print(0, print_chat, ">> Prepare . . .");
set_cvar_float("sv_restart", 2.0);
return PLUGIN_HANDLED;
}