Code:
dbg_log(4, "%32s mp_timelimit: %f g_originalTimelimit: %f", "vote_setupEnd(in)", get_cvar_float("mp_timelimit"), g_originalTimelimit);
g_originalTimelimit = get_cvar_float("mp_timelimit");
// as long as the time limit isn't set to 0, we can manage the end of the map automatically
dbg_log(2, "%32s mp_timelimit: %f g_originalTimelimit: %f", "vote_setupEnd(out)", get_cvar_float("mp_timelimit"), g_originalTimelimit);
new secondsLeft = get_timeleft();
dbg_log(2, "%32s mp_timelimit: %f", "map_manageEnd(in)", get_cvar_float("mp_timelimit"));
server_cmd("mp_timelimit 0");
//new chatTime = floatround(get_cvar_float("mp_chattime"), floatround_floor);
// change the map after "chattime" is over
set_task(floatmax(get_cvar_float("mp_chattime"), 2.0), "map_change");
dbg_log(2, "%32s mp_timelimit: %f", "map_manageEnd(out)", get_cvar_float("mp_timelimit"));
// make sure the reset time is the original time limit
// change the map after "chattime" is over
set_task(floatmax(get_cvar_float("mp_chattime"), 2.0), "map_change");
// announce: "time to choose"
new bool:allowExtend = !allowStay && ((isRunoff && g_choiceCnt == 1) || (!(g_voteStatus & VOTE_FORCED) && !isRunoff && get_cvar_float("mp_timelimit") < get_pcvar_float(cvar_extendmapMax)));
allowExtend = !allowStay && ((isRunoff && g_choiceCnt == 1) || (!isRunoff && get_cvar_float("mp_timelimit") < get_pcvar_float(cvar_extendmapMax)));
dbg_log(2, "%32s mp_timelimit: %f g_rtvWait: %f extendmapStep: %f", "map_extend(in)", get_cvar_float("mp_timelimit"), g_rtvWait, get_pcvar_float(cvar_extendmapStep));
// reset the "rtv wait" time, taking into consideration the map extension
g_rtvWait = get_cvar_float("mp_timelimit") + g_rtvWait;
set_cvar_float("mp_timelimit", get_cvar_float("mp_timelimit") + get_pcvar_float(cvar_extendmapStep));
dbg_log(2, "%32s mp_timelimit: %f g_rtvWait: %f extendmapStep: %f", "map_extend(out)", get_cvar_float("mp_timelimit"), g_rtvWait, get_pcvar_float(cvar_extendmapStep));
// restore the map's timelimit, just in case we had changed it
// probably admin did something dumb like changed the map time limit below
// the time remaining in the map, thus making the map over immediately.
dbg_log(2, "%32s mp_timelimit: %f", "map_getMinutesElapsed(in/out)", get_cvar_float("mp_timelimit"));
return get_cvar_float("mp_timelimit") - (float(get_timeleft()) / 60.0);
// make sure enough time has gone by on the current map
// make sure the rtv reminder timer has stopped
// initialize the rtv reminder timer to repeat how many rocks are still needed, at regular intervals
dbg_log(2, "%32s mp_timelimit: %f g_originalTimelimit: %f", "srv_handleEmpty(in)", get_cvar_float("mp_timelimit"), g_originalTimelimit);
if (g_originalTimelimit != get_cvar_float("mp_timelimit"))
// means that if someone comes into the server, the time limit will
// be the extended time limit rather than the normal time limit. bad.
// reset the original time limit
dbg_log(2, "%32s mp_timelimit: %f g_originalTimelimit: %f", "srv_handleEmpty(out)", get_cvar_float("mp_timelimit"), g_originalTimelimit);
dbg_log(2, "%32s mp_timelimit: %f g_originalTimelimit: %f", "map_restoreOriginalTimeLimit(in)", get_cvar_float("mp_timelimit"), g_originalTimelimit);
server_cmd("mp_timelimit %f", g_originalTimelimit);
dbg_log(2, "%32s mp_timelimit: %f g_originalTimelimit: %f", "map_restoreOriginalTimeLimit(out)", get_cvar_float("mp_timelimit"), g_originalTimelimit);
// grab the current game time
new Float:gameTime = get_gametime();