.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Cyborg Factory > RealBot > The RealBot 'Source'
The RealBot 'Source' Discuss things about the source code. You can here point out bugs, share ideas and code. Assign to become an 'official team member' and so on!

Reply
 
Thread Tools
Re: Problem with RealBot and CSBot:
Old
  (#11)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: Problem with RealBot and CSBot: - 05-10-2004

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]++;
        }
    }

  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com