View Single Post
Bot Creation Help (AMXx)
Old
  (#1)
twistedeuphoria
Member
 
Status: Offline
Posts: 2
Join Date: Aug 2005
Default Bot Creation Help (AMXx) - 31-08-2005

Hello, I've been trying for a few days to create fakeclients/bots through AMX Mod X for CS. I've attempted to use the creation code for RealBot (adapted to AMXx, of course) but have only succeeded in getting the bot to join the server (not join a team, etc). Also, for some reason "bot<id><BOT><> entered the game" is not called until the next round after I have used the command to create the bot. Here is what I have so far (with the corresponding lines from RB above each line). I have been assured that each command is correct (and yes the general syntax is correct), both by BAILOPAN and a small amount of testing of my own. I'm hoping I missed something essential, because otherwise I'm stuck.

Code:
		//BotEnt = (*g_engfuncs.pfnCreateFakeClient) (c_name);
		new bot = engfunc(EngFunc_CreateFakeClient,name)
	
		//BotEnt->v.frags = 0;
		entity_set_float(bot,EV_FL_frags,0.0)

		// CALL_GAME_ENTITY (PLID, "player", VARS (BotEnt));
		dllfunc(MetaFunc_CallGameEntity,"player",bot)
		
		//(*g_engfuncs.pfnSetClientKeyValue) (clientIndex, infobuffer, "model", "gina");
		engfunc(EngFunc_SetClientKeyValue,bot,"model","gina")
		
	    //(*g_engfuncs.pfnSetClientKeyValue) (clientIndex, infobuffer, "rate",  "3500.000000");
		engfunc(EngFunc_SetClientKeyValue,bot,"rate","3500.000000")
		
		//(*g_engfuncs.pfnSetClientKeyValue) (clientIndex, infobuffer, "cl_updaterate", "20");
		engfunc(EngFunc_SetClientKeyValue,bot,"cl_updaterate","20")
		
		//(*g_engfuncs.pfnSetClientKeyValue) (clientIndex, infobuffer, "cl_lw",  "1");
		engfunc(EngFunc_SetClientKeyValue,bot,"cl_lw","1")
		
		//(*g_engfuncs.pfnSetClientKeyValue) (clientIndex, infobuffer, "cl_lc",  "1");
		engfunc(EngFunc_SetClientKeyValue,bot,"cl_lc","1")
		
		//(*g_engfuncs.pfnSetClientKeyValue) (clientIndex, infobuffer, "tracker",  "0");
		engfunc(EngFunc_SetClientKeyValue,bot,"tracker","0")
		
		//(*g_engfuncs.pfnSetClientKeyValue) (clientIndex, infobuffer, "cl_dlmax", "128");
		engfunc(EngFunc_SetClientKeyValue,bot,"cl_dlmax","128")
		
		//(*g_engfuncs.pfnSetClientKeyValue) (clientIndex, infobuffer, "lefthand", "1");
		engfunc(EngFunc_SetClientKeyValue,bot,"lefthand","1")
		
		//(*g_engfuncs.pfnSetClientKeyValue) (clientIndex, infobuffer, "friends", "0");
		engfunc(EngFunc_SetClientKeyValue,bot,"friends","0")
		
		//(*g_engfuncs.pfnSetClientKeyValue) (clientIndex, infobuffer, "dm", "0");
		engfunc(EngFunc_SetClientKeyValue,bot,"dm","0")
		
		//(*g_engfuncs.pfnSetClientKeyValue) (clientIndex, infobuffer, "ah", "1");
		engfunc(EngFunc_SetClientKeyValue,bot,"_ah","0")
		
		//From the PB MM fix for the new Steam update
		engfunc(EngFunc_SetClientKeyValue,bot,"_vgui_menus","0")
		
		//MDLL_ClientConnect (BotEnt, c_name, "127.0.0.1", ptr);
		new error[129]
		dllfunc(DLLFunc_ClientConnect,bot,name,"127.0.0.1",error,128)
		
		//MDLL_ClientPutInServer (BotEnt);
		dllfunc(DLLFunc_ClientPutInServer,bot)
		
		//BotEnt->v.flags |= FL_THIRDPARTYBOT;
		new flags = entity_get_int(bot,EV_INT_flags)
		flags |= FL_FAKECLIENT
		entity_set_int(bot,EV_INT_flags,flags)		
		
		// pBot->iTeam = atoi (arg1);
		entity_set_int(bot,EV_INT_team,1)
Yes, I know it doesn't have the menu catch and execute command set, however, I did hook it with another function and no menu was ever called for the bot.

Thanks in advance!
  
Reply With Quote