1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Weapon Replacement for DeathMatch

Discussion in 'Ask a Coder' started by [FU2]SpawnKiller, Nov 23, 2003.

  1. [FU2]SpawnKiller

    [FU2]SpawnKiller New Member

    Joined:
    Sep 13, 2003
    Messages:
    26
    Likes Received:
    0
    How can I reset this to run from a bool so that I can pick and choose which rifle to use??

    Code:
    function ModifyPlayer(Pawn Other)
    {
    	DeathMatchPlus(Level.Game).GiveWeapon(Other,"SniperRifles_v102.ZarkAssaultRifle");
    
    	if ( NextMutator != None )
    		NextMutator.ModifyPlayer(Other);
    }
    
    This is what I am using else where but with the DeathMatchPlus(Level.Game).GiveWeapon I am unsure how to recode this

    Code:
        	if (Other.IsA('SniperRifle') && bGiveCustomSniperRifle )
    		{
    		ReplaceWith(Other,"SniperRifles_v102.CustomSniperRifle");
    		return false;
    		}
    
    		if (Other.IsA('SniperRifle') && bGiveZarkAssaultRifle )
    		{
    		ReplaceWith(Other,"SniperRifles_v102.ZarkAssaultRifle");
    		return false;
    		}
    

    THANKS
     
  2. [FU2]SpawnKiller

    [FU2]SpawnKiller New Member

    Joined:
    Sep 13, 2003
    Messages:
    26
    Likes Received:
    0
    Got it Working

    this works with an ini file

    Code:
    	bUseCustomSniperRifle,  //CustomSniperRifle
    	bUseZarkAssaultRifle,   //ZarkAssaultRifle
    	bUseCustomWeaponMut;	//Toggle for Custom Weapon Mutator
    
    
    
    
    
    
    
    
    function ModifyPlayer(Pawn Other)
    {
    	if ( bUseCustomWeaponMut )
    	{
    		If ( bUseCustomSniperRifle )
    		{
    			DeathMatchPlus(Level.Game).GiveWeapon(Other,"SniperRifles_v102.CustomSniperRifle");
    			return;
    		};
    
    		If ( bUseZarkAssaultRifle )
    		{
    			DeathMatchPlus(Level.Game).GiveWeapon(Other,"SniperRifles_v102.ZarkAssaultRifle");
    			return;
    		}
    
    	}
    
    
    	if ( NextMutator != None )
    		NextMutator.ModifyPlayer(Other);
    }
    
     

Share This Page