Posts: 916
Threads: 65
Joined: Jun 2011
07-19-2011, 18:54
Any one knows how to do such a thing?
I know theres switchToWeapon but it needs a weapon name, is there a way to just switch to next weapon?
Posts: 916
Threads: 65
Joined: Jun 2011
07-19-2011, 19:26
(This post was last modified: 07-19-2011, 20:16 by Scripts18.)
(07-19-2011, 19:17)iAegle Wrote: C++ Code
weaponList = self getWeaponListPrimaries();
curWeapon = self getCurrentWeapon();
for( i = 0; i < weaponList.size; i++ )
{
if( curWeapon == weaponList[i] )
continue;
if( isDefined( weaponList[ i+1 ] ) )
{
self switchToWeapon( weaponList[ i+1 ] );
break;
}
else
{
self switchToWeapon( weaponList[ i-1 ] );
break;
}
}
?
Looks exactly like what I need thx alot
can you just explain me how to add this as a self function? so I can do self weaponNext and it switch to the next weapon?
EDIT : I get unknown fucntion for
weaponList = self getWeaponListPrimaries();
EDIT: you forgot a s to weapon
EDIT: got it working nvm