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.