sv_show_other the ability to use the command showothers

This commit is contained in:
GreYFoX 2011-03-19 11:22:03 +02:00
parent 0d0f72b059
commit ed5c9c1d92
2 changed files with 11 additions and 6 deletions

View file

@ -207,5 +207,6 @@ MACRO_CONFIG_INT(SvResetPickus, sv_reset_pickups, 0, 0, 1, CFGFLAG_SERVER, "Whet
MACRO_CONFIG_INT(ClShowOthers, cl_show_others, 0, 0, 1, CFGFLAG_CLIENT|CFGFLAG_SAVE, "Show players in other teams", IConsole::CONSOLELEVEL_USER)
MACRO_CONFIG_INT(ClShowEntities, cl_show_entities, 0, 0, 1, CFGFLAG_CLIENT, "Cheat to show game tiles", IConsole::CONSOLELEVEL_USER)
MACRO_CONFIG_INT(ClPredictOldHookthrough, cl_predict_oldht, 0, 0, 1, CFGFLAG_CLIENT, "Client predicts old Hookthrough", IConsole::CONSOLELEVEL_USER)
MACRO_CONFIG_INT(SvShowOthers, sv_show_others, 1, 0, 1, CFGFLAG_SERVER, "Whether players can user the command showothers or not", IConsole::CONSOLELEVEL_ADMIN)
#endif

View file

@ -967,16 +967,20 @@ void CGameContext::ConShowOthers(IConsole::IResult *pResult, void *pUserData, in
CPlayer *pPlayer = pSelf->m_apPlayers[ClientID];
if(!pPlayer)
return;
if(pPlayer->m_IsUsingDDRaceClient)
if(g_Config.m_SvShowOthers)
{
if(pResult->NumArguments())
pPlayer->m_ShowOthers = pResult->GetInteger(0);
if(pPlayer->m_IsUsingDDRaceClient)
{
if(pResult->NumArguments())
pPlayer->m_ShowOthers = pResult->GetInteger(0);
else
pPlayer->m_ShowOthers = !pPlayer->m_ShowOthers;
}
else
pPlayer->m_ShowOthers = !pPlayer->m_ShowOthers;
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", "Showing players from other teams is only available with DDRace Client, http://DDRace.info");
}
else
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", "Showing players from other teams is only available with DDRace Client, http://DDRace.info");
pSelf->Console()->PrintResponse(IConsole::OUTPUT_LEVEL_STANDARD, "info", "Showing players from other teams is disabled by the server admin");
}
void CGameContext::Mute(NETADDR *Addr, int Secs, const char *pDisplayName)