i'm trying to make my machineguns only able to fire in aiming only, not hip, so i took the code out of LAW and LAWFire, but it keeps going out of ironsights after each shot, and I cant figure out how to make it do this only when magammoremaining=0.
dp28weapon:
dp28Fire:
do i need to post default props too for help?
dp28weapon:
Spoiler!
Code:
class DP28 extends KFWeapon;
// Killing Floor's Light Anti Tank Weapon.
// This is probably about as badass as things get....
simulated event WeaponTick(float dt)
{
[COLOR=Red] if(AmmoAmount(0) == 0)
MagAmmoRemaining = 0;
super.Weapontick(dt);[/COLOR]
}
/**
* Handles all the functionality for zooming in including
* setting the parameters for the weapon, pawn, and playercontroller
*
* @param bAnimateTransition whether or not to animate this zoom transition
*/
simulated function ZoomIn(bool bAnimateTransition)
{
if( Level.TimeSeconds < FireMode[0].NextFireTime )
{
return;
}
super.ZoomIn(bAnimateTransition);
if( bAnimateTransition )
{
if( bZoomOutInterrupted )
{
PlayAnim('Raise',1.0,0.1);
}
else
{
PlayAnim('Raise',1.0,0.1);
}
}
}
/**
* Handles all the functionality for zooming out including
* setting the parameters for the weapon, pawn, and playercontroller
*
* @param bAnimateTransition whether or not to animate this zoom transition
*/
simulated function ZoomOut(bool bAnimateTransition)
{
super.ZoomOut(false);
if( bAnimateTransition )
{
TweenAnim(IdleAnim,FastZoomOutTime);
}
}
dp28Fire:
Spoiler!
Code:
class dp28fire extends kffire;
function bool AllowFire()
{
if( Instigator != none && Instigator.IsHumanControlled() )
{
if( !KFWeapon(Weapon).bAimingRifle || KFWeapon(Weapon).bZoomingIn )
{
return false;
}
}
[COLOR=Red]return ( Weapon.AmmoAmount(ThisModeNum) >= AmmoPerFire);[/COLOR]
}
function ServerPlayFiring()
{
Super.ServerPlayFiring();
KFWeapon(Weapon).ZoomOut(false);
}
function PlayFiring()
{
Super.PlayFiring();
KFWeapon(Weapon).ZoomOut(false);
}
do i need to post default props too for help?