Something like this should work.
datablock AudioProfile( sfxDeath0 )
{
fileName = "./death0.wav";
description = audioClosest3d;
preload = false;
};
datablock AudioProfile( sfxDeath1 )
{
fileName = "./death1.wav";
description = audioClosest3d;
preload = false;
};
package CustomDeathSounds
{
function player::playDeathCry( %obj )
{
%obj.playAudio( 0, "sfxDeath" @ getRandom( 0, 1 ) );
}
};
activatePackage( CustomDeathSounds );