Show who locked and unlocked a team

This commit is contained in:
def 2014-06-26 01:33:10 +02:00
parent d023db5dfd
commit f3257e3949

View file

@ -650,21 +650,26 @@ void CGameContext::ConLockTeam(IConsole::IResult *pResult, void *pUserData)
if(Team > TEAM_FLOCK && Team < TEAM_SUPER)
{
char aBuf[512];
if(Lock)
{
((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.SetTeamLock(Team, false);
str_format(aBuf, sizeof(aBuf), "Your team is now unlocked (by %s).", pSelf->Server()->ClientName(pResult->m_ClientID));
for (int i = 0; i < MAX_CLIENTS; i++)
if (((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.m_Core.Team(i) == Team)
pSelf->SendChatTarget(i, "Your team is now unlocked.");
pSelf->SendChatTarget(i, aBuf);
}
else
{
((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.SetTeamLock(Team, true);
str_format(aBuf, sizeof(aBuf), "Your team is now locked (by %s). After the race started killing will kill everyone in your team.", pSelf->Server()->ClientName(pResult->m_ClientID));
for (int i = 0; i < MAX_CLIENTS; i++)
if (((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.m_Core.Team(i) == Team)
pSelf->SendChatTarget(i, "Your team is now locked. After the race started killing will kill everyone in your team.");
pSelf->SendChatTarget(i, aBuf);
}
}
else