RTV Adjustments

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401718
This commit is contained in:
Michael McKoy 2007-11-23 01:06:35 +00:00
parent 9be4c043a4
commit d0bcaecdef

View File

@ -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 <mapname>");
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.