Announcement

Collapse
No announcement yet.

Disable Dual Rilfe

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Disable Dual Rilfe

    I've been learning how to code weapons all of 2 days now, so here’s my next problem ive hit

    Managed to get my 2nd weapon in game and it’s a straight rip of the Assault Rifle. What I want is single assault rifle but im getting dual or twin mode. How would I go about disabling dual mode for the assault rifle?

    I sorta know my way about defaultproperties but lost at simulated function... etc. Would I be setting something too false in there? Cheers.

    #2
    This should help, place this in your weapon that extends the AssaultRifle. Delete or comment the old out first.

    Code:
    function bool HandlePickupQuery( pickup Item ){
    
    	bDualMode = False;
    	if ( item.inventorytype == AmmoClass[1] ){
    		if ( (AmmoCharge[1] >= MaxAmmo(1)) && (AmmoCharge[0] >= MaxAmmo(0)) )
    			return true;
    		item.AnnouncePickup(Pawn(Owner));
    		AddAmmo(50, 0);
    		AddAmmo(Ammo(item).AmmoAmount, 1);
    		item.SetRespawn();
    		return true;
    	}
    	if ( Inventory == None ) return false;
    	return Inventory.HandlePickupQuery(Item);
    }
    No more dual assault rifle, simply adds ammo to the current one.

    Comment


      #3
      Cheers Morphias, works a treat

      Comment

      Working...
      X