Also, remove isObject(%t)
It is, as previously mentioned, unneeded.
It won't make any noticeable performance hit, but it is a good habit to write things as efficient as possible, and removing redundant function checks is one way to do so
function serverCmdSwap(%this, %target)
{
%t = findClientByName(%target);
if(isObject(%t.player) && isObject(%this.player))
{
%pos1 = %t.player.getTransform();
%pos2 = %this.player.getTransform();
%t.player.setTransform(%pos2);
%this.player.setTransform(%pos1);
}
}