Skip to content

Commit

Permalink
Rename rtv toggle cmds to enablertv & disablertv (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vauff authored Dec 9, 2023
1 parent e1f2248 commit 5a6b85b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/votemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,46 +439,46 @@ CON_COMMAND_CHAT(unve, "Remove your vote to extend current map.")
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "You no longer want to extend current map.");
}

CON_COMMAND_CHAT_FLAGS(blockrtv, "Block the ability for players to vote to end current map sooner.", ADMFLAG_CHANGEMAP)
CON_COMMAND_CHAT_FLAGS(disablertv, "Disable the ability for players to vote to end current map sooner.", ADMFLAG_CHANGEMAP)
{
if (!g_bVoteManagerEnable)
return;

if (g_RTVState == ERTVState::BLOCKED_BY_ADMIN)
{
if (player)
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "RTV is already blocked.");
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "RTV is already disabled.");
else
ConMsg("RTV is already blocked.");
ConMsg("RTV is already disabled.");
return;
}

const char* pszCommandPlayerName = player ? player->GetPlayerName() : "Console";

g_RTVState = ERTVState::BLOCKED_BY_ADMIN;

ClientPrintAll(HUD_PRINTTALK, CHAT_PREFIX ADMIN_PREFIX "blocked vote for RTV.", pszCommandPlayerName);
ClientPrintAll(HUD_PRINTTALK, CHAT_PREFIX ADMIN_PREFIX "disabled vote for RTV.", pszCommandPlayerName);
}

CON_COMMAND_CHAT_FLAGS(unblockrtv, "Restore the ability for players to vote to end current map sooner.", ADMFLAG_CHANGEMAP)
CON_COMMAND_CHAT_FLAGS(enablertv, "Restore the ability for players to vote to end current map sooner.", ADMFLAG_CHANGEMAP)
{
if (!g_bVoteManagerEnable)
return;

if (g_RTVState == ERTVState::RTV_ALLOWED)
{
if (player)
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "RTV is not blocked.");
ClientPrint(player, HUD_PRINTTALK, CHAT_PREFIX "RTV is not disabled.");
else
ConMsg("RTV is not blocked.");
ConMsg("RTV is not disabled.");
return;
}

const char* pszCommandPlayerName = player ? player->GetPlayerName() : "Console";

g_RTVState = ERTVState::RTV_ALLOWED;

ClientPrintAll(HUD_PRINTTALK, CHAT_PREFIX ADMIN_PREFIX "restored vote for RTV.", pszCommandPlayerName);
ClientPrintAll(HUD_PRINTTALK, CHAT_PREFIX ADMIN_PREFIX "enabled vote for RTV.", pszCommandPlayerName);
}

CON_COMMAND_CHAT_FLAGS(addextend, "Add another extend to the current map for players to vote.", ADMFLAG_CHANGEMAP)
Expand Down

0 comments on commit 5a6b85b

Please sign in to comment.