danpaul88 wrote on Fri, 25 April 2014 03:58 |
Passing an empty string to Select_Weapon makes them select the first weapon in their weapon bag. If they only have one weapon or the sniper rifle is their primary weapon (index 0) then your code is not causing a weapon switch and thus will not trigger switching time.
void WeaponBagClass::Deselect()
{
this->Select_Index (0);
}
0 is a valid weapon index, thus they select the weapon at position 0.
|
Calling it by itself does indeed work, however that doesn't leave them holding the original weapon.
Calling this:
const char *weap = Get_Current_Weapon(obj);
if (weap)
{
Commands->Select_Weapon(obj,"");
Commands->Select_Weapon (obj,weap);
}
Works in both 3.4.4, and 4.1 single player LAN, it only doesn't work in 4.1 when on-line (as a client to the server).
[Updated on: Fri, 25 April 2014 10:38]
Report message to a moderator