mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Show who locked and unlocked a team
This commit is contained in:
parent
d023db5dfd
commit
f3257e3949
|
@ -650,21 +650,26 @@ void CGameContext::ConLockTeam(IConsole::IResult *pResult, void *pUserData)
|
||||||
|
|
||||||
if(Team > TEAM_FLOCK && Team < TEAM_SUPER)
|
if(Team > TEAM_FLOCK && Team < TEAM_SUPER)
|
||||||
{
|
{
|
||||||
|
char aBuf[512];
|
||||||
if(Lock)
|
if(Lock)
|
||||||
{
|
{
|
||||||
((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.SetTeamLock(Team, false);
|
((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++)
|
for (int i = 0; i < MAX_CLIENTS; i++)
|
||||||
if (((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.m_Core.Team(i) == Team)
|
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
|
else
|
||||||
{
|
{
|
||||||
((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.SetTeamLock(Team, true);
|
((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++)
|
for (int i = 0; i < MAX_CLIENTS; i++)
|
||||||
if (((CGameControllerDDRace*) pSelf->m_pController)->m_Teams.m_Core.Team(i) == Team)
|
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
|
else
|
||||||
|
|
Loading…
Reference in a new issue