Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename rtv toggle cmds to enablertv & disablertv #133

Merged
merged 1 commit into from
Dec 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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