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.

Insert Sound Response

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

  1. [FU2]SpawnKiller

    [FU2]SpawnKiller New Member

    Joined:
    Sep 13, 2003
    Messages:
    26
    Likes Received:
    0
    HOW CAN I INSERT A SOUIND RESPONSE AS WELL AS THE MESSAGE IN THIS CODE???

    Code:
    		{
    			if ( DeactivateDamageMomentum || !I.bActive )
    				Momentum = vect(0,0,0);
    			if ( InstigatorDamageScale > 0 )
    				InstigatedBy.TakeDamage(ActualDamage * (InstigatorDamageScale / 50), InstigatedBy, HitLocation, Momentum, DamageType);
    			ActualDamage *= VictimDamageScale / 100;
    			InstigatedBy.ClientMessage( "THE PERSON YOU ARE SHOOTING IS STILL UNDER PROTECTION" );
    			BroadcastLocalizedMessage(class'SpawnKillMessage', 0, InstigatedBy.PlayerReplicationInfo, Victim.PlayerReplicationInfo);
    		}
    
     
  2. EvilDrWong

    EvilDrWong Every line of code elevates you

    Joined:
    Jun 16, 2001
    Messages:
    932
    Likes Received:
    0
    [smartass] YOURE ON THE RIGHT TRACK, FROM WHAT I CAN TELL, BUT I DONT KNOW WHERE YOURE DOING THIS. [/smartass] ;)
    heh, sorry :p
    Instead of BroadcastLocalizedMessage you can send the InstigatedBy.Controller the same message by using
    Code:
    InstigatedBy.Controller.ReceiveLocalizedMessage(class'SpawnKillMessage', 0, InstigatedBy.PlayerReplicationInfo, Victim.PlayerReplicationInfo);
    
    And to play the sound you can do something simple like this
    Code:
    Victim.PlaySound(sound'SpawnProtectionHit');
    
    Hope that helps
     
  3. [FU2]SpawnKiller

    [FU2]SpawnKiller New Member

    Joined:
    Sep 13, 2003
    Messages:
    26
    Likes Received:
    0
    what difference will the instigatedby.controller make??
     
  4. EvilDrWong

    EvilDrWong Every line of code elevates you

    Joined:
    Jun 16, 2001
    Messages:
    932
    Likes Received:
    0
    Itll send the message to only the player who tried to shoot the SpawnProtected guy, instead of everyone in the level :)
     

Share This Page