You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- People like to troll rtv then insta unrtv, so this stops that
- Also print vote counts in unrtv commands, so players can check current rtv count without the need to rtv themselves or have someone else newly rtv.
Copy file name to clipboardExpand all lines: src/votemanager.cpp
+12-3Lines changed: 12 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -233,7 +233,7 @@ CON_COMMAND_CHAT(rtv, "- Vote to end the current map sooner")
233
233
if (pPlayer->GetRTVVoteTime() + 60.0f > GetGlobals()->curtime)
234
234
{
235
235
int iRemainingTime = (int)(pPlayer->GetRTVVoteTime() + 60.0f - GetGlobals()->curtime);
236
-
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX"Wait %i seconds before you can RTV again.", iRemainingTime);
236
+
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX"Wait %i seconds before you can RTV.", iRemainingTime);
237
237
return;
238
238
}
239
239
@@ -268,12 +268,21 @@ CON_COMMAND_CHAT(unrtv, "- Remove your vote to end the current map sooner")
268
268
269
269
if (!pPlayer->GetRTVVote())
270
270
{
271
-
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX"You have not voted to RTV current map.");
271
+
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX"You have not voted to RTV current map (%i voted, %i needed).", g_pVoteManager->GetCurrentRTVCount(), g_pVoteManager->GetNeededRTVCount());
272
+
return;
273
+
}
274
+
275
+
if (pPlayer->GetRTVVoteTime() + 60.0f > GetGlobals()->curtime)
276
+
{
277
+
int iRemainingTime = (int)(pPlayer->GetRTVVoteTime() + 60.0f - GetGlobals()->curtime);
278
+
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX"Wait %i seconds before you can remove your RTV.", iRemainingTime);
272
279
return;
273
280
}
274
281
275
282
pPlayer->SetRTVVote(false);
276
-
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX"You no longer want to RTV current map.");
283
+
pPlayer->SetRTVVoteTime(GetGlobals()->curtime);
284
+
285
+
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX"You no longer want to RTV current map (%i voted, %i needed).", g_pVoteManager->GetCurrentRTVCount(), g_pVoteManager->GetNeededRTVCount());
277
286
}
278
287
279
288
CON_COMMAND_CHAT(ve, "- Vote to extend current map")
0 commit comments