View Single Post
Re: Getting teams in CS - "TeamInfo"
Old
  (#3)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,620
Join Date: Jul 2004
Location: Bulgaria
Default Re: Getting teams in CS - "TeamInfo" - 12-02-2006

KWo thanks you so much. I was forgot that I must get the player index via the message.
So here the right function:
Code:
// This message is sent whenever information for the teams is sended. - THE STORM
void Client_CS_TeamInfo (void *p, int/* iPlayerIndex*/)
{

    static int iPlayerIndex;

    switch (state++)
    {
    case 0:
        iPlayerIndex = *(int *)p;
        break;
    case 1:
        if (strcmp((char *) p, "UNASSIGNED") == 0) 
        {
            clients[iPlayerIndex - 1].iTeam = TEAM_CS_UNASSIGNED;
        }
        else if (strcmp((char *) p, "TERRORIST") == 0)
        {
            clients[iPlayerIndex - 1].iTeam = TEAM_CS_TERRORIST;
        }
        else if (strcmp((char *) p, "CT") == 0)
        {
            clients[iPlayerIndex - 1].iTeam = TEAM_CS_COUNTER;
        }
        else if (strcmp((char *) p, "SPECTATOR") == 0)
        {
            clients[iPlayerIndex - 1].iTeam = TEAM_CS_SPECTATOR;
        }
        break;
    }
}
No more team detection with models.

Last edited by The Storm; 12-02-2006 at 18:41..
  
Reply With Quote