.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   The RealBot 'Source' (http://forums.bots-united.com/forumdisplay.php?f=52)
-   -   Problem with RealBot and CSBot: (http://forums.bots-united.com/showthread.php?t=2681)

sPlOrYgOn 05-10-2004 07:40

Re: Problem with RealBot and CSBot:
 
another way would be to catch "TeamInfo" messages..
except they are unreliable because the time they are sent is when someone joins but when that someone barely joins he has no team and it won't send another TeamInfo message until the next time someone joins..
each time someone joins it gets sent for all the players to refresh their team or something..
this is statsme's implementation of catching these messages.. from v2.7 but also used in v2.8
PHP Code:

// team is changed then this msg is send
void Client_TeamInfo_CS(voidmValue)
{    
    if (
mPlayer) return;

    static 
int index;

    switch (
mState++) {
    case 
0:
        
index = *(int*)mValue;
        break;
    case 
1:
        const 
charteam = (char*)mValue;

        
int i;
        
        for(
0sm.team_num ; ++i)
            if ( !
strcmpi(sm.team_name[i],team) ) 
                break;

        
//accept only new teams, max. 4 teams
        
if ( == sm.team_num && )
            
strcpysm.team_name[sm.team_num++], team);

        
player_t*pPlayer GET_PLAYER_POINTER_Iindex );

        if ( !
pPlayer->ingame ) {//this is bot...
            
edict_tpEntity INDEXENT(index);
            
PlayerConnectpEntity STRING(pEntity->v.netname), "127.0.0.1:27005" );
            
PlayerPutInServerpPlayer );
        }

        
strcpy(pPlayer->team_namesm.team_name[i]); //save name of team
        
pPlayer->team_index i;
        
sm.team_players[0] = 0;
        
sm.team_players[1] = 0;
        
sm.team_players[2] = 0;
        
sm.team_players[3] = 0;
        for ( 
1<= gpGlobals->maxClients; ++)
        {
            
pPlayer GET_PLAYER_POINTER_I);
            
sm.team_players[pPlayer->team_index]++;
        }
    }




All times are GMT +2. The time now is 09:45.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.