View Single Post
Re: Need some help with pickup pistols
Old
  (#5)
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: Need some help with pickup pistols - 22-11-2004

OK I try with wait time but again is not working.
I think that the two codes for Secndary and Primari weapon pickup are meset up are togeder.
So I post the code here but I post it clean with no wait times becose maybe there is a mistake in the code.Wait time is not working.

Code:
 		 // Near to Weapon ?
 			else if(f_item_distance<50)
 			{
 			   // Secondary weapon.
 			   int iWeaponNum = 0;
 
 			   for (i = 0; i < 7; i++)
 			   {
 				  if (pBot->pEdict->v.weapons & (1 << cs_weapon_select[i].iId))
 					 iWeaponNum = i;
 			   }
 
 			   if (iWeaponNum > 0)
 			   {
 		    	  if(pBot->current_weapon.iId != cs_weapon_select[iWeaponNum].iId)
 				  {
 		    	  if(pBot->current_weapon.iId != CS_WEAPON_INSWITCH)
 				  SelectWeaponbyNumber(pBot, iWeaponNum);
 				  }
 				  else
 				  FakeClientCommand(pEdict, "drop","", NULL);
 				  if (BotHasShield (pBot)) // If we have the shield...
 				  FakeClientCommand(pEdict, "drop","", NULL); // discard both shield and pistol
 			   }
 			   else
 				   pBot->iNumWeaponPickups++;
 			}
 			else
 			{
 				// Primary weapon.
 				int iWeaponNum = HighestWeaponOfEdict(pEdict);
 		    	if (iWeaponNum > 6 || BotHasPrimaryWeapon(pBot) || BotHasShield (pBot))
 				{
 		    		if(pBot->current_weapon.iId != cs_weapon_select[iWeaponNum].iId)
 					{
 		    		    if(pBot->current_weapon.iId != CS_WEAPON_INSWITCH)
 		    		    	SelectWeaponbyNumber(pBot,iWeaponNum);
 					}
 					else
 		    		    FakeClientCommand(pEdict, "drop","", NULL);
 
 				}
 				else
 					pBot->iNumWeaponPickups++;
 			}
 			break;
Tell me where I mistake.
  
Reply With Quote