I am currently trying to change all 3 team names in TF2 (Spectator, Red, Blu), but with no success.
Relevant code:
PHP Code:
public OnMapStart()
{
RenameTeams();
}
stock RenameTeams()
{
new iTeam = -1;
new String:teamNameA[32], String:teamNameB[32], String:teamNameC[32];
Format(teamNameA, sizeof(teamNameA), "A");
Format(teamNameB, sizeof(teamNameB), "B");
Format(teamNameC, sizeof(teamNameC), "C");
while((iTeam = FindEntityByClassname(iTeam, "tf_team")) != -1)
{
new iTeamNum = GetEntData(iTeam, FindSendPropInfo("CTFTeam", "m_iTeamNum"));
if(iTeamNum == Team_Blue)
{
SetEntDataString(iTeam, FindSendPropInfo("CTFTeam", "m_szTeamname"), teamNameA, 16, true);
}
else if(iTeamNum == Team_Red)
{
SetEntDataString(iTeam, FindSendPropInfo("CTFTeam", "m_szTeamname"), teamNameB, 16, true);
}
else if(iTeamNum == Team_Spec)
{
SetEntDataString(iTeam, FindSendPropInfo("CTFTeam", "m_szTeamname"), teamNameC, 16, true);
}
}
}
I have also tried it with CTeam, but to no avail. Is it really not possible to change a team's name without enabling tournament mode (or sending a fake CVar value, causing glitches)?
Any help would be appreciated.
__________________
Stopped hosting servers as of November 2018, no longer active around here.