View Single Post
Re: Slight problem with uber simple bot.
Old
  (#4)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: Slight problem with uber simple bot. - 10-03-2004

I don't know why this works, it just does though. Change where necissary...

Code:
   const char* pszName = "Badger";
   char szRejectMsg[ 128 ];
   edict_t* pSpot = NULL;   
   edict_t* pBot = NULL;
   pBot = ( *g_engfuncs.pfnCreateFakeClient ) ( pszName );
   if ( ! FNullEnt( pBot ) )
   {
	  CALL_GAME_ENTITY( PLID, "player", VARS( pBot ) );
	  pBot->v.flags |= FL_FAKECLIENT;
	  MDLL_ClientConnect( pBot, pszName, "127.0.0.1", szRejectMsg );
	  MDLL_ClientPutInServer( pBot );
	  while ( ( pSpot = FIND_ENTITY_BY_STRING( pSpot, "classname", "info_join_team" ) ) != NULL )
	  {
		 if ( pSpot->v.team == atoi( CMD_ARGV( 1 ) ) )
		 {
			MDLL_Touch( pSpot, pBot );
			break;
		 }
	  }
	  ( *g_engfuncs.pfnRunPlayerMove ) ( pBot, pBot->v.v_angle, 0, 0, 0, pBot->v.button, 0, 0 );
   }
  
Reply With Quote