PDA

View Full Version : Weapon wont use ammo?!


FireSlash
13th Nov 2001, 09:26 PM
when i spawn this, it has 9999 ammo. it wont use any of that 9999 ammo. if i manually set it to 0 ammo, it will not fire, but if i pick up new ammo, it does not add the value to the status bar, or fire.

maybe i missed somthing... heres the code.

{fixed}

FireSlash
14th Nov 2001, 04:03 PM
hmm. got the same results when trying to make the Chainsaw use ammo. i must be doing somthing wrong... :(

EasyRaider
14th Nov 2001, 04:53 PM
1) I think you should use
AmmoType.UseAmmo (1);
instead of
ammotype.ammoamount--;
but AFAIK both should work.

2) Don't try to set AmmoType in DefaultProperties. AmmoType references an ammo object, not a class.

3) Try to add
if (AmmoType == None)
GiveAmmo(Pawn(Owner));
before
if (ammotype.ammoamount > 0) {

FireSlash
14th Nov 2001, 06:55 PM
thanks. the
if (AmmoType == None)
GiveAmmo(Pawn(Owner));
fixed it.:)