mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 18:18:18 +00:00
Adding pause specific message when players use /pause (instead of joined the game/spectators).
This commit is contained in:
parent
c17d3cdeda
commit
0ae0b0bb83
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue