Here is a command I made a long time ago that spins the player in a circle from the way they are already facing using the axisToEuler and eulerToAxis functions. Note the fact I add 180 onto the angle on line 11 (%deg = ...) - this was to make my angle go from 1 to 360, when usually it's -179 to 180.
Try playing with the numbers a bit to see how it works and then remove the loop if you want it to be instant.
function serverCmdPiderman(%cl)
{
%pl = %cl.player;
if(!isObject(%pl))
return;
%pl.spawnExplosion(deathProjectile,1);
%rot = getWords(%pl.getTransform(),3,6);
%deg = getWord(axisToEuler(%rot),2) + 180;
%pos = %pl.getPosition();
for(%i = 0; %i < 360; %i++)
{
%deg += 1;
if(%deg >= 360)
%deg -= 360;
%new = eulerToAxis("0 0 " @ %deg - 180);
%pl.schedule(%i * 0.5,setTransform,%pos SPC %new);
}
%cl.schedule(%i * 0.5,loadAvatar,"Add-Ons/Script_Piderman/piderman.cs");
}
(wow I never thought this would have a use)