function Armor::Damage(%this,%obj,%sourceObject,%position,%damage,%damageType)
{
if(%obj.client.getClassName() $= "GameConnection")
{
if(!%client.justdied)
{
if(%damage > 0)
%obj.client.player.PlayRandomPain();
}
}
return Parent::Damage(%this,%obj,%sourceObject,%position,%damage,%damageType);
}
function GameConnection::onDeath(%client)
{
%client.justdied = 1;
%client.player.PlayRandomDeath();
return Parent::onDeath(%client);
}
function GameConnection::spawnPlayer(%client)
{
%client.justdied = 0;
return Parent::spawnPlayer(%client);
}
What's this? You don't define Player::playRandomPain anywhere, and you've already modified Player::playPain to play random pain sounds anyway.