Well. You're mixing up client and server sided code.
$mvYaw = $pi; is client sided and is going to make your player do an instant spin - as in a teleport to the orientation it is already facing. It does basically nothing. Your code is supposed to be server-sided however, so this can't be used to turn the player. You're using %this inside spin(), but it's not set to anything. Your datablock is called SpinAudio, but you're trying to use SpinSound. You're also using new AudioProfile instead of datablock AudioProfile, but I'm not sure if that causes problems. You're trying to call servercmdSelf Delete with a player object, but it needs a client object, and you also forgot to activate the package.
I'd do it like this:
if(!isObject(SpinSound))
{
datablock AudioProfile(SpinSound)
{
filename = "./spin.wav";
description = AudioDefault3d;
preload = true;
};
}
function Player::Spin(%this)
{
serverPlay3D(SpinSound, %this.getPosition());
//Find a way to make the player spin.
}
package SpinAttack
{
function Player::ActivateStuff(%this)
{
Parent::ActivateStuff(%this);
%this.Spin();
initContainerRadiusSearch(%this.getPosition(), 2.5, $TypeMasks::PlayerObjectType);
while(%obj = containerSearchNext())
if(%obj != %this)
%obj.kill();
}
};
activatePackage(SpinAttack);
It's going to kill everyone close to the player (but not the attacker) and play the sound, but I don't know how to get a smooth spin right now.