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.

Protection Line Error

Discussion in 'Ask a Coder' started by [FU2]SpawnKiller, Sep 14, 2003.

  1. [FU2]SpawnKiller

    [FU2]SpawnKiller New Member

    Joined:
    Sep 13, 2003
    Messages:
    26
    Likes Received:
    0
    How Should the 2 if lines be combined for this to work??


    Code:
    function bool PreventDeath(Pawn Killed, Pawn Killer, name damageType, vector HitLocation)
    {
    	if ( !bInstantHit(Killer, Killed) && DamageType == 'Shot' && Killed != None && Killer != None && Killed != Killer )
    	if ( !bAltInstantHit(Killer, Killed) && DamageType == 'Decapitated' && Killed != None && Killer != None && Killed != Killer )
        {
    		LastKiller = Killer;
    		LastVictim = Killed;
    		SetTimer(0.01, False);
    		Killed.Health = Killed.default.Health;
    		Super.PreventDeath(Killed, Killer, DamageType, HitLocation);
    		return true;
    	}
    
    	return Super.PreventDeath(Killed, Killer, DamageType, HitLocation);
    }

    Thanks
     
  2. EvilDrWong

    EvilDrWong Every line of code elevates you

    Joined:
    Jun 16, 2001
    Messages:
    932
    Likes Received:
    0
    whoa, jesus.. um... i think this will work... but... egad, such a long If :p
    Code:
    if ((!bInstantHit(Killer, Killed)&&DamageType=='Shot')&&(!bAltInstantHit(Killer, Killed)&&DamageType=='Decapitated')&&Killed!=None&&Killer!=None&&Killed!=Killer)
    
     
    Last edited: Sep 14, 2003
  3. [FU2]SpawnKiller

    [FU2]SpawnKiller New Member

    Joined:
    Sep 13, 2003
    Messages:
    26
    Likes Received:
    0
    thanks a lot just cannot seem to get those correct here

    lol

    thanks a bunch
     

Share This Page