1

Topic: Get player team

hi
I want get other players team in client side, I write a function in gameclient.h and declare it in gameclient.cpp
I use these methods to get team but they don't work correctly

1)
m_Snap.m_paPlayerInfos[x]->m_Team;

2)
m_aClients[x].m_Team;

2

Re: Get player team

write the whole function here, and i'll see, normally it should work

#yemDX is a known troll

3

Re: Get player team

int CGameClient::Get_team()
{
if(! m_Snap.m_aCharacters[g_Config.m_ClShowPlayer].m_Active)
str_format(aaBuf, sizeof(aaBuf), "DEACTIVE");
else if(m_Snap.m_paPlayerInfos[g_Config.m_ClShowPlayer]->m_Team == TEAM_RED)
str_format(aaBuf, sizeof(aaBuf), "RED");
else
str_format(aaBuf, sizeof(aaBuf), "BLUE");

return 0;
}

//ClShowPlayer: variable for input players ID.

4

Re: Get player team

what's your problem?

i guess, you' want to display RED or BLUE, don't you?

#yemDX is a known troll

5

Re: Get player team

Pikotee wrote:

what's your problem?

i guess, you' want to display RED or BLUE, don't you?

yeah I wanna display team but this code doesn't work correcltly
when I change the player id in game , aaBuf will be equal to DEACTIVE!
it just work with LocalClientID