Clean up server messages a bit

This commit is contained in:
def 2017-05-21 01:20:04 +02:00
parent 3c7f9c15d2
commit 562dee6e38
2 changed files with 11 additions and 7 deletions

View file

@ -819,7 +819,10 @@ void CGameContext::ConInviteTeam(IConsole::IResult *pResult, void *pUserData)
str_format(aBuf, sizeof aBuf, "'%s' invited you to team %d.", pSelf->Server()->ClientName(pResult->m_ClientID), Team);
pSelf->SendChatTarget(Target, aBuf);
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "invite", "Player has been notified");
str_format(aBuf, sizeof aBuf, "'%s' invited '%s' to your team.", pSelf->Server()->ClientName(pResult->m_ClientID), pSelf->Server()->ClientName(Target));;
for (int i = 0; i < MAX_CLIENTS; i++)
if (((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.m_Core.Team(i) == Team)
pSelf->SendChatTarget(i, aBuf);
}
else
pSelf->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "invite", "Can't invite players to this team");

View file

@ -629,16 +629,17 @@ void CGameTeams::OnCharacterDeath(int ClientID, int Weapon)
ChangeTeamState(Team, CGameTeams::TEAMSTATE_OPEN);
char aBuf[512];
str_format(aBuf, sizeof(aBuf), "Everyone in your locked team was killed because you %s.", Weapon == WEAPON_SELF ? "killed" : "died");
GameServer()->SendChatTarget(ClientID, aBuf);
str_format(aBuf, sizeof(aBuf), "Everyone in your locked team was killed because '%s' %s.", Server()->ClientName(ClientID), Weapon == WEAPON_SELF ? "killed" : "died");
for (int i = 0; i < MAX_CLIENTS; i++)
if(m_Core.Team(i) == Team && i != ClientID && GameServer()->m_apPlayers[i])
if(m_Core.Team(i) == Team && GameServer()->m_apPlayers[i])
{
if(i != ClientID)
{
GameServer()->m_apPlayers[i]->KillCharacter(WEAPON_SELF);
if (Weapon == WEAPON_SELF)
GameServer()->m_apPlayers[i]->Respawn(true); // spawn the rest of team with weak hook on the killer
}
GameServer()->SendChatTarget(i, aBuf);
}
}