Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » Commands->Select_Weapon doesn't work clientside.
Re: Commands->Select_Weapon doesn't work clientside. [message #487367 is a reply to message #487363] Fri, 25 April 2014 10:13 Go to previous messageGo to previous message
Jerad2142 is currently offline  Jerad2142
Messages: 3813
Registered: July 2006
Location: USA
Karma:
General (3 Stars)
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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: tdbedit.exe fails to list the strings I have under the default tab in my strings file.
Next Topic: Possibly memory leak SSGM
Goto Forum:
  


Current Time: Sun Dec 22 14:11:58 MST 2024

Total time taken to generate the page: 0.00921 seconds