Author Topic: Hiding player name outside of minigame?  (Read 2544 times)

%client.player.setShapeNameDistance(0);
This works however you can see their name if you are really close to them.
And that's why he made this topic.

%client.player.setShapeNameDistance(0);
This works however you can see their name if you are really close to them.
Thanks.

Might as well get help as to why this doesn't work:
Code: [Select]
//////////////////////////
//Script_Creep/server.cs//
//////////////////////////
//Evar678 (ID 10015 / 16752)

function servercmdcreepon(%client,%player)
{
%player.hideNode("ALL");
messageClient(%client,'',"\c2All Nodes Hidden!");
}
function servercmdcreepoff(%client,%player)
{
%player.unHideNode("ALL");
if(isObject(%player.client))
        {
            %player.client.applyBodyParts();
            %player.client.applyBodyColors();
        }
        else
{
            applyDefaultCharacterPrefs(%player);
}
messageClient(%client, '',"\c2All Nodes Unhidden!");
}
};

This, however, did work, but when anyone else typed it, it hid my nodes, but did not restore them to their previous state, it simply unhid ALL nodes.
Code: [Select]
$creep=0;

function servercmdcreep(%client)
{
if($creep==0)
{
%player=localclientconnection.player;
%player.hideNode("ALL");
messageClient(%client,'',"\c2All Nodes Hidden!");
$creep=1;
}
else
{
%player=localclientconnection.player;
%player.unhideNode("ALL");
if(isObject(%player.client))
          {
            %player.client.applyBodyParts();
            %player.client.applyBodyColors();
        }
          else
{
            applyDefaultCharacterPrefs(%player);
}
messageClient(%client, '',"\c2All Nodes Unhidden!");
$creep = 0;
}

Should I have used %client.player?
« Last Edit: June 27, 2012, 10:39:49 PM by Evar678 »

1. You're using localclientconnection.player
Use %client.player
2. Because you're using a global variable.
When anyone types /creep, $creep is going to become 1, so when the next person types it, it's going to act like they have it turned on.
Use %client.player.creep instead of $creep


This works however you can see their name if you are really close to them.

Create the player object yourself or use an AIPlayer.

Code: [Select]
function serverCmdTogCreep(%client)
{
if(isObject(%client.player))
{
if(!%client.player.creep)
{
%client.player.hideNode("ALL");
%client.player.setShapeNameDistance(0);
messageClient(%client,'',"\c2All Nodes Hidden!");
%client.player.creep = 1;
}
else
{
%client.player.unHideNode("ALL");
%client.player.client.applyBodyParts();
%client.player.setShapeNameDistance(1000);
messageClient(%client, '',"\c2All Nodes Unhidden!");
%client.player.creep = 0;
}
}
}
I believe this is what you're looking for. I combined the first 2 functions and made it check if the player existed. I also made it hide the name as best I could and used %client.player.

I'm not sure what you are trying to do with the last function though.

<snip>

Why thank you!


But, how would I use an AIPlayer?

Why thank you!


But, how would I use an AIPlayer?

I believe Port knows a more efficient/proper way but it would be along the lines of:

%ai = new aiPlayer(){..args..};

%client.setControlObject(%ai);
%client.player = %ai;

Also, you don't have to use an AIPlayer.

Also, you don't have to use an AIPlayer.

You can get rid of shapenames? Also, are YOU able to replicate setShapeName?

I believe Port knows a more efficient/proper way but it would be along the lines of:

%ai = new aiPlayer(){..args..};

%client.setControlObject(%ai);
%client.player = %ai;

I think the only args you need are position, scale, and datablock. Correct me if I'm wrong.

You can get rid of shapenames? Also, are YOU able to replicate setShapeName?
setShapeName() can't be used on players. Badspot did this so people can't impersonate other players.

setShapeName() can't be used on players. Badspot did this so people can't impersonate other players.

When you create a player, it has no shape name by default. Figuring out the rest should be pretty simple.