plugins/mapchooser.sp
changeset 2178 7769e1d56f64
parent 2165 ca3757e676f6
child 2179 e36379b15572
     1.1 --- a/plugins/mapchooser.sp	Mon Jul 07 22:11:49 2008 +0000
     1.2 +++ b/plugins/mapchooser.sp	Mon Jul 07 22:17:55 2008 +0000
     1.3 @@ -69,6 +69,7 @@
     1.4  new Handle:g_Cvar_DontChange = INVALID_HANDLE;
     1.5  new Handle:g_Cvar_EndOfMapVote = INVALID_HANDLE;
     1.6  new Handle:g_Cvar_VoteDuration = INVALID_HANDLE;
     1.7 +
     1.8  new Handle:g_VoteTimer = INVALID_HANDLE;
     1.9  new Handle:g_RetryTimer = INVALID_HANDLE;
    1.10  
    1.11 @@ -221,17 +222,8 @@
    1.12  	g_HasVoteStarted = false;
    1.13  	g_WaitingForVote = false;
    1.14  	
    1.15 -	if (g_VoteTimer != INVALID_HANDLE)
    1.16 -	{
    1.17 -		KillTimer(g_VoteTimer);
    1.18 -		g_VoteTimer = INVALID_HANDLE;
    1.19 -	}
    1.20 -	
    1.21 -	if (g_RetryTimer != INVALID_HANDLE)
    1.22 -	{
    1.23 -		KillTimer(g_RetryTimer);
    1.24 -		g_RetryTimer = INVALID_HANDLE;
    1.25 -	}
    1.26 +	g_VoteTimer = INVALID_HANDLE;
    1.27 +	g_RetryTimer = INVALID_HANDLE;
    1.28  	
    1.29  	decl String:map[32];
    1.30  	GetCurrentMap(map, sizeof(map));
    1.31 @@ -302,7 +294,7 @@
    1.32  				g_VoteTimer = INVALID_HANDLE;
    1.33  			}	
    1.34  			
    1.35 -			g_VoteTimer = CreateTimer(float(time - startTime), Timer_StartMapVote);
    1.36 +			g_VoteTimer = CreateTimer(float(time - startTime), Timer_StartMapVote, _, TIMER_FLAG_NO_MAPCHANGE);
    1.37  		}		
    1.38  	}
    1.39  }
    1.40 @@ -339,7 +331,7 @@
    1.41  	if (g_ChangeMapAtRoundEnd)
    1.42  	{
    1.43  		g_ChangeMapAtRoundEnd = false;
    1.44 -		CreateTimer(2.0, Timer_ChangeMap, INVALID_HANDLE);
    1.45 +		CreateTimer(2.0, Timer_ChangeMap, INVALID_HANDLE, _, TIMER_FLAG_NO_MAPCHANGE);
    1.46  	}
    1.47  	
    1.48  	if (!GetArraySize(g_MapList) || g_HasVoteStarted || g_MapVoteCompleted || !GetConVarBool(g_Cvar_EndOfMapVote))
    1.49 @@ -379,7 +371,7 @@
    1.50  	if (g_ChangeMapAtRoundEnd)
    1.51  	{
    1.52  		g_ChangeMapAtRoundEnd = false;
    1.53 -		CreateTimer(2.0, Timer_ChangeMap, INVALID_HANDLE);
    1.54 +		CreateTimer(2.0, Timer_ChangeMap, INVALID_HANDLE, _, TIMER_FLAG_NO_MAPCHANGE);
    1.55  	}
    1.56  	
    1.57  	if (!GetArraySize(g_MapList) || g_HasVoteStarted || g_MapVoteCompleted)
    1.58 @@ -475,7 +467,7 @@
    1.59  	if (IsVoteInProgress())
    1.60  	{
    1.61  		// Can't start a vote, try again in 5 seconds.
    1.62 -		g_RetryTimer = CreateTimer(5.0, Timer_StartMapVote);
    1.63 +		g_RetryTimer = CreateTimer(5.0, Timer_StartMapVote, _, TIMER_FLAG_NO_MAPCHANGE);
    1.64  		return;
    1.65  	}
    1.66