Add sv_map_vote to disable /map

This commit is contained in:
def 2014-03-07 23:58:22 +01:00
parent c9b5e350d0
commit ffde53a443
2 changed files with 8 additions and 0 deletions

View file

@ -178,6 +178,7 @@ MACRO_CONFIG_STR(SvRulesLine10, sv_rules_line10, 40, "", CFGFLAG_SERVER, "Rules
MACRO_CONFIG_INT(SvTeam, sv_team, 1, 0, 3, CFGFLAG_SERVER, "Teams configuration (0 = off, 1 = on but optional, 2 = must play only with teams, 3 = forced random team only for you)")
MACRO_CONFIG_INT(SvTeamMaxSize, sv_max_team_size, 16, 2, 16, CFGFLAG_SERVER, "Maximum team size (from 2 to 16)")
MACRO_CONFIG_INT(SvMapVote, sv_map_vote, 1, 0, 1, CFGFLAG_SERVER, "Whether to allow /map")
MACRO_CONFIG_STR(SvAnnouncementFileName, sv_announcement_filename, 24, "announcement.txt", CFGFLAG_SERVER, "file which will have the announcement, each one at a line")
MACRO_CONFIG_INT(SvAnnouncementInterval, sv_announcement_interval, 300, 1, 9999, CFGFLAG_SERVER, "time(minutes) in which the announcement will be displayed from the announcement file")

View file

@ -510,6 +510,13 @@ void CGameContext::ConMap(IConsole::IResult *pResult, void *pUserData)
if (!CheckClientID(pResult->m_ClientID))
return;
if (g_Config.m_SvMapVote == 0)
{
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "map",
"Admin has disabled /map");
return;
}
if (pResult->NumArguments() <= 0)
{
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "map", "Example: /map adr3 to call vote for Adrenaline 3. This means that the map name must start with 'a' and contain the characters 'd', 'r' and '3' in that order");