This is what I edit.
But this code won't stop countdown after restart once.
What's wrong?
Code:
#include <amxmodx>
new countdown
new g_SayText
new roundstart
public plugin_init()
{
register_plugin("Auto-Restart", "1.0", "ToT | V!PER")
register_event("TextMsg", "restart_countdown", "a", "2&#Game_C")
register_cvar("amx_autorestart", "10.0")
g_SayText = get_user_msgid("SayText")
}
public restart_countdown()
{
set_task(1.0, "start_countdown", _, _, _, "b")
set_task(get_cvar_float("amx_autorestart"), "restart_round", _)
}
public start_countdown()
{
countdown++
new sec = 11 - countdown
client_printc(0, "\y[AMXX] After %i sec will restart once", sec)
if(countdown == get_cvar_float("amx_autorestart"))
{
countdown = 0
client_printc(0, "\y[AMXX] Game Start")
}
return PLUGIN_HANDLED
}
public restart_round()
{
server_cmd("sv_restartround 1")
return PLUGIN_HANDLED
}
stock client_printc(const id, const string[], {Float, Sql, Resul,_}:...) {
new msg[191], players[32], count = 1;
vformat(msg, sizeof msg - 1, string, 3);
replace_all(msg,190,"\g","^4");
replace_all(msg,190,"\y","^1");
replace_all(msg,190,"\t","^3");
if(id)
players[0] = id;
else
get_players(players,count,"ch");
new index;
for (new i = 0 ; i < count ; i++)
{
index = players[i];
message_begin(MSG_ONE_UNRELIABLE, g_SayText,_, index);
write_byte(index);
write_string(msg);
message_end();
}
}
__________________
You can be a SUPER coder but you Haven't to say such as "stupid, etc." words to the others