View Single Post
Re: Hi, thanks and help!
Old
  (#2)
The Storm
Council Member / E[POD]bot developer
 
The Storm's Avatar
 
Status: Offline
Posts: 1,619
Join Date: Jul 2004
Location: Bulgaria
Default Re: Hi, thanks and help! - 30-06-2005

I can't understand what do you mean... Maybe you try to say that you don't know how ammo remain in the weapon ? If is that you need to export a message. In EPB I use this one
Code:
// This message is sent whenever ammo ammounts are adjusted (up or down).
// NOTE: Logging reveals that CS uses it very unreliable !
void BotClient_CS_AmmoX(void *p, int bot_index)
{
   static int index;
   static int ammount;
   int ammo_index;

   bot_t *pBot = &bots[bot_index];

   if (state == 0) {
	  index = *(int *) p;	   // ammo index (for type of ammo)
   } else if (state == 1) {
	  ammount = *(int *) p;	 // the ammount of ammo currently available

	  pBot->m_rgAmmo[index] = ammount;  // store it away
	  if (pBot->current_weapon.iId > CS_WEAPON_INSWITCH) {
		 ammo_index = pBot->current_weapon.iId;

#ifdef _DEBUG
		 report_log(LOG_MESSAGE, "BotClient_CS_AmmoX",
				    "Botname=%s iId=%d Amount=%d", pBot->name, ammo_index,
					ammount);
#endif

		 // update the ammo counts for this weapon...
		 pBot->current_weapon.iAmmo1 =
			 pBot->m_rgAmmo[weapon_defs[ammo_index].iAmmo1];
		 pBot->current_weapon.iAmmo2 =
			 pBot->m_rgAmmo[weapon_defs[ammo_index].iAmmo2];
	  }

   }
   state++;
}
I hope that I help.
  
Reply With Quote