in my MH2Base:
Code: Select all
if(bClientHitsounds)
{
if (PlayerPawn(InstigatedBy) != None && (Victim != InstigatedBy) && (actualDamage > 0))
{
if (PlayerPawn(Victim) != None || Bot(Victim) != None) // When player/bot shoot other player/bot
HitSound = Sound'HitsoundTeam';
else
if (Victim.AttitudeToPlayer == ATTITUDE_Ignore || Victim.AttitudeToPlayer == ATTITUDE_Friendly || Victim.AttitudeToPlayer == ATTITUDE_Follow)
HitSound = Sound'HitsoundTeam';
else
HitSound = Sound'HitsoundEnemy';
MH2PlayerPawn(InstigatedBy).MH2ClientPlaySound(HitSound);
//PlayerPawn(InstigatedBy).PlaySound(HitSound, SLOT_None, clientHitVolume, false);
//PlayerPawn(InstigatedBy).PlaySound(HitSound, SLOT_Interface, clientHitVolume, false);
//PlayerPawn(InstigatedBy).PlaySound(HitSound, , clientHitVolume, false);
}
}
Code: Select all
class MH2PlayerPawn expands PlayerPawn;
var Name MH2ClientPlayHitsound;
var Name UltimaNuke; // UkBadboy damagetype
Var Name MushroomNuke; // UkBadboy Altdamagetype
//Play a sound client side (so only client will hear it
simulated function MH2ClientPlaySound(sound ASound, optional bool bInterrupt, optional bool bVolumeControl )
{
local actor SoundPlayer;
local Name Damagetype;
LastPlaySound = Level.TimeSeconds; // so voice messages won't overlap
if ( ViewTarget != None )
SoundPlayer = ViewTarget;
else
SoundPlayer = self;
if((Damagetype=='RedeemerDeath') || (Damagetype=='UltimaNuke') || (Damagetype=='MushroomNuke'))
{
SoundPlayer.PlaySound(ASound, SLOT_None, 8.0, bInterrupt);
SoundPlayer.PlaySound(ASound, SLOT_Interface, 8.0, bInterrupt);
SoundPlayer.PlaySound(ASound, SLOT_Misc, 8.0, bInterrupt);
SoundPlayer.PlaySound(ASound, SLOT_Talk, 8.0, bInterrupt);
}
else
SoundPlayer.PlaySound(ASound, SLOT_None, 16.0, bInterrupt);
SoundPlayer.PlaySound(ASound, SLOT_Interface, 16.0, bInterrupt);
SoundPlayer.PlaySound(ASound, SLOT_Misc, 16.0, bInterrupt);
SoundPlayer.PlaySound(ASound, SLOT_Talk, 16.0, bInterrupt);
}
defaultproperties
{
}