Here's how I did it, and it's the best way to make someone invisible for me:
Code: Select all
makeInvisible(arg)
{
if(!isdefined(self.isInv)) self.isInv= false;
if((arg) && (!self.isInv))
{
self detachall();
self setmodel("");
self.isInv= true;
}
else
{
if(self.pers["team"]=="allies")
{
self setmodel(level.american_xmodel);
self attach(level.german_xmodel_head, "", true);
self attach(self.hatModel, "", true);
}
else if(self.pers["team"]=="axis")
{
self setmodel(level.german_xmodel);
self attach(level.german_xmodel_head, "", true);
self attach(self.hatModel, "", true);
}
self.isInv= false;
}
}
You need to call makeInvisible(true) on a player to make him invisible and then when you want him visible again, set makeInvisible to false. Now you do need to edit these four global variables:
Code: Select all
level.german_xmodel = "xmodel/playerbody_german_normandy01";
level.german_xmodel_head = "xmodel/head_german_normandy_josh";
level.american_xmodel = "xmodel/playerbody_default";
level.american_xmodel_head = "xmodel/head_us_ranger_preston";
The presets here are for the default american model and the default german model. You might need to alter this if you're using different allies. Other than that, this code is pretty much fool proof.