Yes and no.
Use set_task() or something to constantly set the roundtimer to your desired value... that won't block round-end stuff... like "target saved", or "hostages have not been saved".
You can't actually detect the timer's actual time... you can detect it's start time (by hooking the event) and calculate.
Something like this:
PHP Code:
#include <amxmodx>
new bool:g_bPaused = false
new Float:g_fTimerStart
new gMsg_RoundTime
public plugin_init()
{
register_event("RoundTime", "event_roundTime", "a")
register_clcmd("test", "cmd_test")
register_clcmd("pausetimer", "cmd_pausetimer")
gMsg_RoundTime = get_user_msgid("RoundTime")
}
public event_roundTime()
{
g_fTimerStart = (read_data(1) ? get_gametime() : 0.0)
}
public cmd_test(id)
{
if(g_fTimerStart)
client_print(0, print_chat, "[debug] timer at: %.1f", get_gametime() - g_fTimerStart)
else
client_print(0, print_chat, "[debug] timer not started")
}
public cmd_pausetimer(id)
{
if(g_bPaused)
event_pauseTimer(0, 0)
else
event_pauseTimer(1, floatround(get_gametime() - g_fTimerStart))
client_print(id, print_chat, "timer %s", g_bPaused ? "unpaused" : "paused")
g_bPaused = !g_bPaused
}
public event_pauseTimer(iPause, iAt)
{
if(!iPause)
{
remove_task(1)
return
}
static iPauseAt
if(iAt)
iPauseAt = iAt
message_begin(MSG_ALL, gMsg_RoundTime)
write_short(iPauseAt)
message_end()
set_task(0.8, "event_pauseTimer", 1) /* don't set task to 0, you can set it to anything but 0.. even negative values */
}
Code NOT tested in-game, but compiles.
__________________