From d0bcaecdef032c3a1c12d2166eccbffebf3b1ad4 Mon Sep 17 00:00:00 2001 From: Michael McKoy Date: Fri, 23 Nov 2007 01:06:35 +0000 Subject: [PATCH] RTV Adjustments --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401718 --- plugins/rockthevote.sp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/plugins/rockthevote.sp b/plugins/rockthevote.sp index 25f3a8a8..6378dc3e 100644 --- a/plugins/rockthevote.sp +++ b/plugins/rockthevote.sp @@ -122,7 +122,7 @@ public OnMapEnd() public bool:OnClientConnect(client, String:rejectmsg[], maxlen) { - if(IsFakeClient(client)) + if(!g_CanRTV || IsFakeClient(client)) return true; g_Voted[client] = false; @@ -136,7 +136,7 @@ public bool:OnClientConnect(client, String:rejectmsg[], maxlen) public OnClientDisconnect(client) { - if(IsFakeClient(client)) + if(!g_CanRTV || IsFakeClient(client)) return; if(g_Voted[client]) @@ -148,8 +148,9 @@ public OnClientDisconnect(client) g_VotesNeeded = RoundToFloor(float(g_Voters) * GetConVarFloat(g_Cvar_Needed)); - if (g_Votes && g_Voters && g_Votes >= g_VotesNeeded && g_RTVAllowed) - { + if (g_Votes && g_Voters && g_Votes >= g_VotesNeeded && g_RTVAllowed && !g_RTVStarted) + { + g_RTVStarted = true; CreateTimer(2.0, Timer_StartRTV, TIMER_FLAG_NO_MAPCHANGE); } } @@ -160,6 +161,12 @@ public Action:Command_Addmap(client, args) { ReplyToCommand(client, "[SM] Usage: sm_rtv_addmap "); return Plugin_Handled; + } + + if (!g_CanRTV) + { + ReplyToCommand(client, "[SM] RockTheVote is not available."); + return Plugin_Handled; } decl String:mapname[64]; @@ -268,7 +275,8 @@ public Action:Command_Say(client, args) PrintToChatAll("[SM] %t", "RTV Requested", name, g_Votes, g_VotesNeeded); if (g_Votes >= g_VotesNeeded) - { + { + g_RTVStarted = true; CreateTimer(2.0, Timer_StartRTV, TIMER_FLAG_NO_MAPCHANGE); } } @@ -321,8 +329,6 @@ public Action:Timer_StartRTV(Handle:timer) return; } - g_RTVStarted = true; - if (IsVoteInProgress()) { // Can't start a vote, try again in 5 seconds.