function servercmdhide(%client)
{
if(!isObject(%player = %client.player) || !%client.isAdmin) //player check
return;
%player.hide = !%client.player.hide; //toggling variable
if(%player.hide) //checking variable
%player.hide(); //hiding player
else
%player.unHide();
}
function Player::Hide(%this)
{
%this.setShapeNameDistance(0);
%this.SpawnExplosion("SpawnProjectile",%this.scale);
%this.hideNode("ALL");
}
function Player::UnHide(%this)
{
%this.setShapeNameDistance(300);
%this.SpawnExplosion("SpawnProjectile",%this.scale);
%this.client.applyBodyParts();
%this.unHideNode("headSkin");
}
Edit: revised for happiness
players make a spawn poof when they /hide