This one should work whatever the roundtime.
PHP Code:
#include <amxmodx>
#include <cstrike>
#define TASKID 1654879
native cs_force_team_win(CsTeams:team)
new const force_team_win_plugin_name[] = "Force Team Win"
new mp_roundtime, Float:g_roundtime
new g_maxplayers, sv_restart
public plugin_init() {
register_plugin("Round Countdown", "1.1", "M249-M4A1/connor")
register_event("HLTV", "eNewRound", "a", "1=0", "2=0")
register_logevent("eRoundStart", 2, "1=Round_Start")
}
public plugin_cfg() {
mp_roundtime = get_cvar_pointer("mp_roundtime")
sv_restart = get_cvar_pointer("sv_restart")
g_maxplayers = get_maxplayers()
}
public eNewRound() {
g_roundtime = get_pcvar_float(mp_roundtime)
}
public eRoundStart() {
if (task_exists(TASKID))
remove_task(TASKID)
set_task(g_roundtime, "doSomething", TASKID)
}
public doSomething(taskid) {
if(is_plugin_loaded(force_team_win_plugin_name) && get_playersnum(1) < g_maxplayers)
cs_force_team_win(CS_TEAM_T)
else
set_pcvar_float(sv_restart, 1.0)
}
edit : added restart if server is full as VEN plugin wouldn't work in that case, but i can replace with slay all players or a team
__________________