Code: Select all
function SwitchWeapon()
{
local int wrand, numweapons;
local weapon NextWeapon;
SetTimer( 60, True); //don't want to constantly switch weapons
NumWeapons = GetLoadoutValues();
wrand = Rand(numWeapons);
if ( (switchTimeover)&&(!WeaponGrabbed) )
{
TossWeapon();
bIsPlayer = True;
WeaponGrabbed = True;
NextWeapon = Spawn(Myloadout[wrand]);
NextWeapon.GiveTo(self);
}
}
function TossWeapon()
{
local vector X,Y,Z;
if ( Weapon == None )
return;
GetAxes(Rotation,X,Y,Z);
Weapon.Destroy();
}
First off, the pawn works as far as HOLDING the weapon and firing it, etc. That's not the problem. All the functions here work.
The problem is that when the weapon actually spawns, he does not pick it up. He has to walk away from it, then back to it to pick it up.
I've already tried the SkaarjTrooper pickup method of Weapon.Touch(self); it was a no go :S
Any ideas?