Код за потвърждение: Избери целия код
#include <amxmodx>
#include <colorchat>
new g_Seconds
new g_SecondsCvar
new prefix
new pref[32]
public plugin_init() {
register_plugin("Auto Game Restart with Countdown Timer", "1.0", "AbeX")
register_event("TextMsg", "game_commencing", "a", "2=#Game_Commencing")
g_SecondsCvar = register_cvar("autorr_time","40.0")
prefix = register_cvar("amx_prefix", "Dust2Respawn"); //prefix
}
public game_commencing() {
if (task_exists(41170))
remove_task(41170)
g_Seconds = floatround(get_pcvar_float(g_SecondsCvar))
new param[32]
set_task(1.0,"count_rr",41170,param,31,"b",0)
}
public count_rr() {
get_pcvar_string(prefix, pref, 31)
g_Seconds--;
set_hudmessage(0, 255, 0, -1.0, 0.1, 0, 6.0, 1.0)
show_hudmessage(0, "Auto restart round after %d seconds",g_Seconds)
if (g_Seconds == 0) {
server_cmd("sv_restartround 1")
remove_task(41170)
ColorChat(0, GREEN, "^x4[%s] S.T.A.Y A.L.I.V.E!!!", pref)
ColorChat(0, GREEN, "^x4[%s] S.T.A.Y A.L.I.V.E!!!", pref)
ColorChat(0, GREEN, "^x4[%s] S.T.A.Y A.L.I.V.E!!!", pref)
ColorChat(0, GREEN, "^x4[%s] S.T.A.Y A.L.I.V.E!!!", pref)
ColorChat(0, GREEN, "^x4[%s] S.T.A.Y A.L.I.V.E!!!", pref)
ColorChat(0, GREEN, "^x4[%s] S.T.A.Y A.L.I.V.E!!!", pref)
}
}