View Single Post
Re: BotClient_CS_HLTV in HPB_template 4 does not work !
Old
  (#5)
Rifleman
This user broke our rules and has been BANNED
 
Status: Offline
Posts: 128
Join Date: Sep 2004
Location: Mars
Default Re: BotClient_CS_HLTV in HPB_template 4 does not work ! - 08-11-2004

Bug FIXED !!! !!!8D

First , I checked the engine function , the hltv is not sent with a edict.But why in hpb_template 4 , the

Code:
			 else if (msg_type == message_HLTV)
				 botMsgFunction = BotClient_CS_HLTV;
is under the
Code:
if (ed)
, I changed its position to

Code:
		 if (msg_type == message_WeaponList)
			botMsgFunction = BotClient_CS_WeaponList;
else if (msg_type == message_HLTV)
	botMsgFunction = BotClient_CS_HLTV;
and the bot dll intercept the hltv message correctly , then we come to the function code itself :

Code:
void BotClient_CS_HLTV(void *p, int bot_index)
{
	static int state = 0; // current state machine state
	static int players = 0;
	int index;
	if (state == 0)
	{
		players = *(int *) p; // check the byte
		state++;
	}
	else if (state == 1)
	{
		  if (players == 0)
		 {
				for (index = 0; index < 32; index++)
				{
					  if (bots[index].is_used)
					  {
							BotSpawnInit (&bots[index]); 
					  }
				 }
		   }
			state = 0;
	 }
}
I changed the original code to the above one , and the result ? It worked ! !!! 8D

Last edited by Rifleman; 08-11-2004 at 05:29..
  
Reply With Quote