RTV Adjustments
--HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401718
This commit is contained in:
parent
9be4c043a4
commit
d0bcaecdef
@ -122,7 +122,7 @@ public OnMapEnd()
|
|||||||
|
|
||||||
public bool:OnClientConnect(client, String:rejectmsg[], maxlen)
|
public bool:OnClientConnect(client, String:rejectmsg[], maxlen)
|
||||||
{
|
{
|
||||||
if(IsFakeClient(client))
|
if(!g_CanRTV || IsFakeClient(client))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
g_Voted[client] = false;
|
g_Voted[client] = false;
|
||||||
@ -136,7 +136,7 @@ public bool:OnClientConnect(client, String:rejectmsg[], maxlen)
|
|||||||
|
|
||||||
public OnClientDisconnect(client)
|
public OnClientDisconnect(client)
|
||||||
{
|
{
|
||||||
if(IsFakeClient(client))
|
if(!g_CanRTV || IsFakeClient(client))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(g_Voted[client])
|
if(g_Voted[client])
|
||||||
@ -148,8 +148,9 @@ public OnClientDisconnect(client)
|
|||||||
|
|
||||||
g_VotesNeeded = RoundToFloor(float(g_Voters) * GetConVarFloat(g_Cvar_Needed));
|
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);
|
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>");
|
ReplyToCommand(client, "[SM] Usage: sm_rtv_addmap <mapname>");
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!g_CanRTV)
|
||||||
|
{
|
||||||
|
ReplyToCommand(client, "[SM] RockTheVote is not available.");
|
||||||
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
|
||||||
decl String:mapname[64];
|
decl String:mapname[64];
|
||||||
@ -268,7 +275,8 @@ public Action:Command_Say(client, args)
|
|||||||
PrintToChatAll("[SM] %t", "RTV Requested", name, g_Votes, g_VotesNeeded);
|
PrintToChatAll("[SM] %t", "RTV Requested", name, g_Votes, g_VotesNeeded);
|
||||||
|
|
||||||
if (g_Votes >= g_VotesNeeded)
|
if (g_Votes >= g_VotesNeeded)
|
||||||
{
|
{
|
||||||
|
g_RTVStarted = true;
|
||||||
CreateTimer(2.0, Timer_StartRTV, TIMER_FLAG_NO_MAPCHANGE);
|
CreateTimer(2.0, Timer_StartRTV, TIMER_FLAG_NO_MAPCHANGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -321,8 +329,6 @@ public Action:Timer_StartRTV(Handle:timer)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_RTVStarted = true;
|
|
||||||
|
|
||||||
if (IsVoteInProgress())
|
if (IsVoteInProgress())
|
||||||
{
|
{
|
||||||
// Can't start a vote, try again in 5 seconds.
|
// Can't start a vote, try again in 5 seconds.
|
||||||
|
Loading…
Reference in New Issue
Block a user