When I use the timer and it is not over, I restart or end or change the game map, the timer continues to execute and runs with the new timer
Code:
#include <sourcemod>
#include <sdktools>
static Handle:gamestart_sec = INVALID_HANDLE;
public OnPluginStart()
{
HookEvent("round_start", Event_RoundStart, EventHookMode_Post);
gamestart_sec = CreateConVar("l4d1_timer_sec","60","", FCVAR_SPONLY);
}
public Action Event_RoundStart(Event event, const char[] name, bool dontBroadcast)
{
CreateTimer(0.1, GameStart,GetConVarInt(gamestart_sec));
}
public Action GameStart(Handle timer,int time)
{
if( time != 0 )
{
PrintHintTextToAll("war: %i sec", time);
CreateTimer( 1.0, GameStart, --time);
if(time <10 && time >0)
{
EmitSoundToAll("ambient/alarms/klaxon1.wav", _, SNDCHAN_AUTO, SNDLEVEL_RAIDSIREN, SND_NOFLAGS, SNDVOL_NORMAL, SNDPITCH_LOW, -1, NULL_VECTOR, NULL_VECTOR, true, 0.0);
}
}
}
__________________
Please forgive, If I'm not describing it accurately. I use google translate
Functional tests are all from L4D1, and are only keen to solve and fix various bugs of L4D1: