Adding pause specific message when players use /pause (instead of joined the game/spectators).

This commit is contained in:
Romain Labolle 2011-06-06 21:54:34 +02:00 committed by GreYFoX
parent c17d3cdeda
commit 0ae0b0bb83
2 changed files with 11 additions and 3 deletions

View file

@ -471,17 +471,17 @@ void CGameContext::ConTogglePause(IConsole::IResult *pResult, void *pUserData, i
if(pPlayer->m_LastSetTeam + pSelf->Server()->TickSpeed() * g_Config.m_SvPauseFrequency <= pSelf->Server()->Tick())
{
pPlayer->SaveCharacter();
pPlayer->SetTeam(TEAM_SPECTATORS);
pPlayer->m_InfoSaved = true;
pPlayer->SetTeam(TEAM_SPECTATORS);
}
else
pResult->Print(IConsole::OUTPUT_LEVEL_STANDARD, "info", "You can\'t pause that often.");
}
else if(pPlayer->GetTeam()==TEAM_SPECTATORS && pPlayer->m_InfoSaved)
{
pPlayer->m_InfoSaved = false;
pPlayer->m_PauseInfo.m_Respawn = true;
pPlayer->SetTeam(TEAM_RED);
pPlayer->m_InfoSaved = false;
//pPlayer->LoadCharacter();//TODO:Check if this system Works
}
else if(pChr)

View file

@ -267,7 +267,15 @@ void CPlayer::SetTeam(int Team)
return;
char aBuf[512];
str_format(aBuf, sizeof(aBuf), "'%s' joined the %s", Server()->ClientName(m_ClientID), GameServer()->m_pController->GetTeamName(Team));
if(m_InfoSaved)
{
if(Team == TEAM_SPECTATORS)
str_format(aBuf, sizeof(aBuf), "'%s' paused", Server()->ClientName(m_ClientID));
else
str_format(aBuf, sizeof(aBuf), "'%s' resumed", Server()->ClientName(m_ClientID));
}
else
str_format(aBuf, sizeof(aBuf), "'%s' joined the %s", Server()->ClientName(m_ClientID), GameServer()->m_pController->GetTeamName(Team));
GameServer()->SendChat(-1, CGameContext::CHAT_ALL, aBuf);
KillCharacter();