It seems as if there is a 12 second offset from the start of map to when the actual map-time countdown begins. This is probably caused by the restarting of map when all players connect after a map change and "game commencing" appears. There is probably a calculation method used to determine this number but it is consistently 12 seconds on my server.
PHP Code:
#include <amxmodx>
#include <amxmisc>
public plugin_init()
{
register_plugin( "Map Time Left" , "0.1" , "bugsy" );
set_task( ( get_cvar_float("mp_timelimit") * 60.0 ) - 108.0 , "set_timer" );
}
public show_timer()
{
new szNextMap[32];
get_cvar_string( "amx_nextmap" , szNextMap , 31 );
new iTimeLeft = get_timeleft();
set_hudmessage( 255 , 255 , 255 , 0.75 , 0.05 , 0 , 1.0 , 1.0 , 0.1 , 0.2 , 13 );
show_hudmessage( 0 , "Time remaining: %d:%02d^nNext map: %s" , iTimeLeft / 60 , iTimeLeft % 60 , szNextMap );
return PLUGIN_CONTINUE
}
public set_timer()
{
set_task( 1.0 , "show_timer" , _, _, _, "b" );
}
__________________