add smc_mapvote_printtoconsole

This commit is contained in:
rtldg 2021-10-05 05:48:08 +00:00
parent 9b00e1f16a
commit a3e3e0682b

View File

@ -49,6 +49,7 @@ Convar g_cvMapVoteShowTier;
Convar g_cvMapVoteRunOff;
Convar g_cvMapVoteRunOffPerc;
Convar g_cvMapVoteRevoteTime;
Convar g_cvMapVotePrintToConsole;
Convar g_cvDisplayTimeRemaining;
Convar g_cvNominateMatches;
@ -184,6 +185,7 @@ public void OnPluginStart()
g_cvMapVoteRunOff = new Convar("smc_mapvote_runoff", "1", "Hold run of votes if winning choice is less than a certain margin", _, true, 0.0, true, 1.0);
g_cvMapVoteRunOffPerc = new Convar("smc_mapvote_runoffpercent", "50", "If winning choice has less than this percent of votes, hold a runoff", _, true, 0.0, true, 100.0);
g_cvMapVoteRevoteTime = new Convar("smc_mapvote_revotetime", "0", "How many minutes after a failed mapvote before rtv is enabled again", _, true, 0.0);
g_cvMapVotePrintToConsole = new Convar("smc_mapvote_printtoconsole", "1", "Prints map votes that each player makes to console.", _, true, 0.0, true, 1.0);
//g_cvDisplayTimeRemaining = new Convar("smc_display_timeleft", "1", "Display remaining messages in chat", _, true, 0.0, true, 1.0);
g_cvNominateMatches = new Convar("smc_nominate_matches", "1", "Prompts a menu which shows all maps which match argument", _, true, 0.0, true, 1.0);
@ -891,6 +893,17 @@ public int Handler_MapVoteMenu(Menu menu, MenuAction action, int param1, int par
{
switch(action)
{
case MenuAction_Select:
{
if (g_cvMapVotePrintToConsole.BoolValue)
{
char map[PLATFORM_MAX_PATH];
menu.GetItem(param2, map, sizeof(map));
PrintToConsoleAll("%N voted for %s", param1, map);
}
}
case MenuAction_DrawItem:
{
if (g_bVoteDelayed[param1])