PDA

View Full Version : weapon conditions



legacy-ruinerr
07-19-2004, 11:09 PM
How the hell do i get the current weapons name that the player is holding, iv looked through the code and searched and cannot find one instance where this happens.

Im inside a class that extends weaponfire ( its a modified version of instantfire ) and i want to be able to do something like this



case ( Weapon )
{
AssaultRifle:
stuff;
break;

MachineGun:
morestuff;
break;

default:
otherstuff;
break;
}

legacy-cknight52
07-19-2004, 11:34 PM
Would all of the weapons you would cycle through be your own?

legacy-cknight52
07-19-2004, 11:36 PM
What I mean is that if you are extending weaponfire, you wouldnt be able to easily call it from any "stock" weapons, as they already point to a given weapon fire class.

you COULD use if statements instead of a switch like:

if(Weapon.IsA('AssaultRifle'))
some stuff;
if(Weapon.IsA...

legacy-krm197
07-20-2004, 02:34 PM
Heh, I had to do this for my smashTV mod that I made..

I think I gave up, but I was close in using the

Pawn.FindInventoryType(class DesiredClass) function.

Try Pawn.Weapon as well (returns a 'weapon' variable for the weapon the pawn is currently using I believe)