1145: fix /settings stuff r=heinrich5991 a=ZombieToad



Co-authored-by: ZombieToad <25847476+zombietoad@users.noreply.github.com>
This commit is contained in:
bors[bot] 2018-06-14 08:23:23 +00:00
commit 51ebc68f71

View file

@ -67,7 +67,7 @@ void CGameContext::ConHelp(IConsole::IResult *pResult, void *pUserData)
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "help",
"/help + any command will show you the help for this command");
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "help",
"Example /help settings will display the help about ");
"Example /help settings will display the help about /settings");
}
else
{
@ -100,13 +100,11 @@ void CGameContext::ConSettings(IConsole::IResult *pResult, void *pUserData)
if (pResult->NumArguments() == 0)
{
pSelf->Console()->Print(
IConsole::OUTPUT_LEVEL_STANDARD,
"setting",
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
"to check a server setting say /settings and setting's name, setting names are:");
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "setting",
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
"teams, cheats, collision, hooking, endlesshooking, me, ");
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "setting",
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
"hitting, oldlaser, timeout, votes, pause and scores");
}
else
@ -119,121 +117,104 @@ void CGameContext::ConSettings(IConsole::IResult *pResult, void *pUserData)
pSelf->m_Tuning.Get("player_hooking", &HookTemp);
if (str_comp(pArg, "teams") == 0)
{
str_format(
aBuf,
sizeof(aBuf),
"%s %s",
str_format(aBuf, sizeof(aBuf), "%s %s",
g_Config.m_SvTeam == 1 ?
"Teams are available on this server" :
(g_Config.m_SvTeam == 0 || g_Config.m_SvTeam == 3) ?
"Teams are not available on this server" :
"You have to be in a team to play on this server", /*g_Config.m_SvTeamStrict ? "and if you die in a team all of you die" : */
"and if you die in a team only you die");
"and all of your team will die if the team is locked");
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings", aBuf);
}
else if (str_comp(pArg, "cheats") == 0)
{
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
aBuf);
g_Config.m_SvTestingCommands ?
"Cheats are enabled on this server" :
"Cheats are disabled on this server");
}
else if (str_comp(pArg, "collision") == 0)
{
pSelf->Console()->Print(
IConsole::OUTPUT_LEVEL_STANDARD,
"settings",
ColTemp ?
"Players can collide on this server" :
"Players Can't collide on this server");
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
ColTemp ?
"Players can collide on this server" :
"Players can't collide on this server");
}
else if (str_comp(pArg, "hooking") == 0)
{
pSelf->Console()->Print(
IConsole::OUTPUT_LEVEL_STANDARD,
"settings",
HookTemp ?
"Players can hook each other on this server" :
"Players Can't hook each other on this server");
pSelf->Console()->Print( IConsole::OUTPUT_LEVEL_STANDARD, "settings",
HookTemp ?
"Players can hook each other on this server" :
"Players can't hook each other on this server");
}
else if (str_comp(pArg, "endlesshooking") == 0)
{
pSelf->Console()->Print(
IConsole::OUTPUT_LEVEL_STANDARD,
"settings",
g_Config.m_SvEndlessDrag ?
"Players can hook time is unlimited" :
"Players can hook time is limited");
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
g_Config.m_SvEndlessDrag ?
"Players hook time is unlimited" :
"Players hook time is limited");
}
else if (str_comp(pArg, "hitting") == 0)
{
pSelf->Console()->Print(
IConsole::OUTPUT_LEVEL_STANDARD,
"settings",
g_Config.m_SvHit ?
"Players' weapons affect each other" :
"Players' weapons has no affect on each other");
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
g_Config.m_SvHit ?
"Players weapons affect others" :
"Players weapons has no affect on others");
}
else if (str_comp(pArg, "oldlaser") == 0)
{
pSelf->Console()->Print(
IConsole::OUTPUT_LEVEL_STANDARD,
"settings",
g_Config.m_SvOldLaser ?
"Lasers can hit you if you shot them and that they pull you towards the bounce origin (Like DDRace Beta)" :
"Lasers can't hit you if you shot them, and they pull others towards the shooter");
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
g_Config.m_SvOldLaser ?
"Lasers can hit you if you shot them and they pull you towards the bounce origin (Like DDRace Beta)" :
"Lasers can't hit you if you shot them, and they pull others towards the shooter");
}
else if (str_comp(pArg, "me") == 0)
{
pSelf->Console()->Print(
IConsole::OUTPUT_LEVEL_STANDARD,
"settings",
g_Config.m_SvSlashMe ?
"Players can use /me commands the famous IRC Command" :
"Players Can't use the /me command");
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
g_Config.m_SvSlashMe ?
"Players can use /me commands the famous IRC Command" :
"Players can't use the /me command");
}
else if (str_comp(pArg, "timeout") == 0)
{
str_format(aBuf, sizeof(aBuf),
"The Server Timeout is currently set to %d seconds",
g_Config.m_ConnTimeout);
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
aBuf);
str_format(aBuf, sizeof(aBuf), "The Server Timeout is currently set to %d seconds", g_Config.m_ConnTimeout);
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings", aBuf);
}
else if (str_comp(pArg, "votes") == 0)
{
pSelf->Console()->Print(
IConsole::OUTPUT_LEVEL_STANDARD,
"settings",
g_Config.m_SvVoteKick ?
"Players can use Callvote menu tab to kick offenders" :
"Players Can't use the Callvote menu tab to kick offenders");
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
g_Config.m_SvVoteKick ?
"Players can use Callvote menu tab to kick offenders" :
"Players can't use the Callvote menu tab to kick offenders");
if (g_Config.m_SvVoteKick)
str_format(
aBuf,
sizeof(aBuf),
"Players are banned for %d second(s) if they get voted off",
g_Config.m_SvVoteKickBantime);
pSelf->Console()->Print(
IConsole::OUTPUT_LEVEL_STANDARD,
"settings",
g_Config.m_SvVoteKickBantime ?
aBuf :
"Players are just kicked and not banned if they get voted off");
{
str_format(aBuf, sizeof(aBuf),
"Players are banned for %d minute(s) if they get voted off", g_Config.m_SvVoteKickBantime);
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
g_Config.m_SvVoteKickBantime ?
aBuf :
"Players are just kicked and not banned if they get voted off");
}
}
else if (str_comp(pArg, "pause") == 0)
{
pSelf->Console()->Print(
IConsole::OUTPUT_LEVEL_STANDARD,
"settings",
g_Config.m_SvPauseable ?
g_Config.m_SvPauseTime ?
"/pause is available on this server and it pauses your time too" :
"/pause is available on this server but it doesn't pause your time"
:"/pause is NOT available on this server");
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
g_Config.m_SvPauseable ?
"/spec will pause you and your tee will vanish" :
"/spec will pause you but your tee will not vanish");
}
else if (str_comp(pArg, "scores") == 0)
{
pSelf->Console()->Print(
IConsole::OUTPUT_LEVEL_STANDARD,
"settings",
g_Config.m_SvHideScore ?
"Scores are private on this server" :
"Scores are public on this server");
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
g_Config.m_SvHideScore ?
"Scores are private on this server" :
"Scores are public on this server");
}
else
{
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "settings",
"no matching settings found, type /settings to view them");
}
}
}