Hello Everyone,
I want an easy way to pause and resume timer, lets take this script by "RU_6uK" as an example
PHP Code:
float g_fSeconds;
bool g_bRoundEnd;
public void OnPluginStart()
{
HookEvent("player_left_safe_area", Event_LeftStartArea);
HookEvent("round_end", Event_RoundEnd);
RegConsoleCmd("sm_duration", Command_Duration, "Display Round Duration To Chat");
}
public Action Event_LeftStartArea(Event event, const char[] name, bool dontBroadcast)
{
g_fSeconds = GetEngineTime();
g_bRoundEnd = false;
return Plugin_Handled;
}
public Action Event_RoundEnd(Event event, const char[] name, bool dontBroadcast)
{
if(!g_bRoundEnd) g_bRoundEnd = true;
return Plugin_Handled;
}
public Action Command_Duration(int client, int args)
{
int secDiff = RoundToFloor(GetEngineTime() - g_fSeconds);
ReplyToCommand(client, "\x04Round Duration: \x03%i min %i sec", secDiff / 60, secDiff % 60);
return Plugin_Handled;
}
Any method to pause it, is acceptable, with a command or event
Thanks