Author Topic: Shapename for admin on the player's head text above  (Read 1180 times)

This my idea write script. I am not sure If this correct. This about Host, SA and admin text above player's head above of the text.
Code: [Select]
package Script_AdminHead

{

   

     function (%client)

 {

  if($Pref::AdminN::enabled)

   %client.Admin.setShapeName(%client.name);

  parent::mountPoint = $HeadSlot(%client)

  datablock StaticShapeData(HostName)

{

 mountPoint = $HeadSlot; = "setShapename"Host";

}

};

activatepackage(Script_AdminHead);

datablock StaticShapeData(SuperAdminName)

{

 mountPoint= $HeadSlot = setShapeName"SuperAdmin";

}

datablock StaticShapeData(AdminName)

{

 mountPoint= $HeadSlot = setShapeName"Admin";

 

};

datablock StaticShapeData(BrickTextEmptyShape)

{
This script are wrong, I know it. I made mistake writing this.
The display picture, I use bricktext event on my head above of the text. This look like, that what I want like this.

Instead use chat message who is host or SA whatever.

Sorry, player shapenames have been gone for a long time.  It can't be done as far as I know.


edit: also your code...ew.
« Last Edit: April 30, 2012, 09:25:56 PM by 420 »

People have been working around it by mounting a bot or something to the player's head and then setting the shapename on that.

People have been working around it by mounting a bot or something to the player's head and then setting the shapename on that.
correct, Brian smith did successfull make his mod brickbuddy. That what I am try writing this.

 
edit: also your code... not very good
mountPoint = $HeadSlot; = "setShapename"Host";

and wtf is this
%client.Admin.setShapeName(%client.name);
I know, That reason, I made thread here for help.
« Last Edit: April 30, 2012, 09:26:42 PM by Cubelands »

correct, Brian smith did successfull make his mod brickbuddy. That what I am try writing this.

How long have you been scripting for this code looks very amateur

How long have you been scripting for this code looks very amateur
Says the guy who's been scripting since the start of TGE

I would suggest that you implement this feature differently, using the color of the shape name rather than trying to modify the actual shape name itself. For example:


package AdminIdentifier {
    function GameConnection::spawnPlayer(%client) {
        Parent::spawnPlayer(%client);
        %player = %client.Player;
        if (%client.isAdmin || %client.isSuperAdmin) {
            %player.identifyAsAdmin();
        }
    }
    function Player::identifyAsAdmin(%player) {
        %player.setShapeNameColor("1 1 0");
    }
};
activatepackage(AdminIdentifier);

« Last Edit: May 01, 2012, 12:31:29 AM by TheRealMint »

I would suggest that you implement this feature differently, using the color of the shape name rather than trying to modify the actual shape name itself. For example:


package AdminIdentifier {
    function GameConnection::spawnPlayer(%client) {
        Parent::spawnPlayer(%client);
        %player = %client.Player;
        if (%client.isAdmin || %client.isSuperAdmin) {
            %player.identifyAsAdmin();
        }
    }
    function Player::identifyAsAdmin(%player) {
        %player.setShapeNameColor("1 1 0");
    }
};
activatepackage(AdminIdentifier);

awesome, I did tested. It was color yellow. But It require StaticShape put on mountPoint of head like $Headslot. I did add this script.

Code: [Select]
package AdminIdentifier {
    function GameConnection::spawnPlayer(%client) {
        Parent::spawnPlayer(%client);
        %player = %client.Player;
        if (%client.isAdmin || %client.isSuperAdmin) {
            %player.setShapeNameColor("1 1 0");
            %player.headtext = %name;
            %Player.mountPoint = $HeadSlot;
        }
    }
};
activatepackage(AdminIdentifier);

datablock StaticShapeData(headTextEmptyShape)

{

        shapefile = "base/data/shapes/empty.dts";

};
        if(isObject(%this.textShape))

        {

                %player.headtext = %name;
                %player.mountPoint = $HeadSlot
        }
                    %player.headShape = new StaticShape()

                {

                        datablock = headTextEmptyShape;

                        position = vectorAdd(%player.getPosition(),"0 0" SPC %player.getDatablock().HeadSizeZ/9 + "0.166");

                        scale = "0.1 0.1 0.1";

                };

        };
« Last Edit: May 01, 2012, 01:13:11 AM by Cubelands »

Hmm.... That just sounds ugly if you ask me. I really wish we could redefine more functions. For instance, it would be really handy if you could do something like this:


package AdminIdentifier {
    function GameConnection::getPlayerName(%client) {
        %name = Parent::getPlayerName(%client);
        if (%client.isAdmin) {
            %name = %name SPC "(Admin)";
        }
        else if (%client.isSuperAdmin) {
            %name = %name SPC "(Super Admin)";
        }
        return %name;
    }
};
activatepackage(AdminIdentifier);


Hmm.... That just sounds ugly if you ask me. I really wish we could redefine more functions. For instance, it would be really handy if you could do something like this:

package AdminIdentifier {
    function GameConnection::getPlayerName(%client) {
        %name = Parent::getPlayerName(%client);
        if (%client.isAdmin) {
            %name = %name SPC "(Admin)";
        }
        else if (%client.isSuperAdmin) {
            %name = %name SPC "(Super Admin)";
        }
        return %name;
    }
};
activatepackage(AdminIdentifier);

aslo I have add this for host.

Code: [Select]
       
        else if (%client.isHost) {
            %name = %name SPC "(Host)";
        }
I learn this very smiple. But I have trouble with error line 34.
what SPC mean?
« Last Edit: May 01, 2012, 02:04:44 AM by Cubelands »

Updated:

Code: [Select]
package AdminIdentifier {
    function GameConnection::getPlayerName(%client) {
        %name = Parent::getPlayerName(%client);
        if (%client.isAdmin) {
            %name = %name SPC "(Admin)";
        }
        else if (%client.isSuperAdmin) {
            %name = %name SPC "(Super Admin)";
        }
else if (%client.isHost) {
            %name = %name SPC "(Host)";
        }
        return %name;
            %player.setShapeNameColor("0 0 0");
        %player.headtext = %name;
        %Player.mountPoint = $HeadSlot;
    }
};
activatepackage(AdminIdentifier);

datablock StaticShapeData(playerTextEmptyShape)

{

        shapefile = "base/data/shapes/empty.dts";

};
        if(isObject(%player.textShape))

        {

                %player.playertext = %name;
    %player.mountPoint = $HeadSlot
%player.textShape = new StaticShape() <--- line 34, I hate this. I did put (); and without (); It keep error.
}
       

                {

                        datablock = playerTextEmptyShape;

                        position = vectorAdd(%player.getPosition(),"0 0" SPC %player.getDatablock().playerSizeZ/9 + "0.166");

                        scale = "0.1 0.1 0.1";

                };

        };

The line above the error needs a ';' at the end, so does after the ().

Generally syntax errors are caused by the line above it or whatnot.

The line above the error needs a ';' at the end, so does after the ().

Generally syntax errors are caused by the line above it or whatnot.

I did put (); and without (); It keep error.

First off, the code TheRealMint gave you in his most recent post does not work, it was an example he said would be nice if it worked. Remove it, and either use the code he gave you in his first post, and nothing else, or if you want it to work how you originally wanted it in the OP, you won't be able to use it at all.
Other than that, there's a problem with pretty much every line, and I don't have the time right now to fix it.

First off, the code TheRealMint gave you in his most recent post does not work, it was an example he said would be nice if it worked. Remove it, and either use the code he gave you in his first post, and nothing else, or if you want it to work how you originally wanted it in the OP, you won't be able to use it at all.
Other than that, there's a problem with pretty much every line, and I don't have the time right now to fix it.
:C, maybe you will do it later.