View Single Post
Re: Creating a bot entity...!
Old
  (#2)
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: Creating a bot entity...! - 15-05-2008

Put your code in code tags next time. Here's my bot creation function (its for Counter-Strike)
Code:
void BotPutInServer (int iTeam, const char *szName)
{
	edict_t *pEdict = g_engfuncs.pfnCreateFakeClient(szName);

	if (FNullEnt( pEdict ))
        {
		ALERT(at_console, "Max. Players reached.  Can't create bot!\n");
		return;
	}
	else
	{
		MDLL_ClientPutInServer( pEdict );

		pEdict->v.flags |= FL_FAKECLIENT;

		ENTITY_SET_KEYVALUE(pEdict, "_vgui_menus", "0");
		ENTITY_SET_KEYVALUE(pEdict, "_cl_autowepswitch", "1");
		ENTITY_SET_KEYVALUE(pEdict, "*bot", "1");
	}
}

Last edited by The Storm; 16-05-2008 at 00:25..
  
Reply With Quote