SA-MP Forums Archive
Player names in colors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Player names in colors (/showthread.php?tid=329699)



Player names in colors - iStrow - 29.03.2012

Player names are in many different colors on my server, i want them to be in only one color, and text above player is for example

Tom_Smith(1) - (1) is probably my id

i just want it to be Tom_Smith and in white color not different color for every player...how can i do that


Re: Player names in colors - Joshb93 - 29.03.2012

pawn Код:
public OnPlayerConnect(playerid)
{
 SetPlayerColor(playerid, COLOR_HERE)
 return 1;
}
Or:

pawn Код:
public OnPlayerSpawn(playerid)
{
 SetPlayerColor(playerid, COLOR_HERE)
 return 1;
}



Re: Player names in colors - Nicholas. - 29.03.2012

I think this what you mean. You don't want the player ID to appear, right.

pawn Код:
public OnPlayerText(playerid, text[])
{
    new textstring[128];
    format(textstring, sizeof(textstring), "%s", text);
    SendPlayerMessageToAll(playerid, textstring);
    return 0;
}
Not tested but It should work.

And....

To set the player color use -
pawn Код:
SetPlayerColor(playerid, COLOR_WHITE)
Example:
pawn Код:
public OnPlayerConnect(playerid)
{
 SetPlayerColor(playerid, COLOR_WHITE)
 return 1;
}



Re: Player names in colors - The__ - 29.03.2012

Quote:
Originally Posted by Nicholas.
Посмотреть сообщение
I think this what you mean. You don't want the player ID to appear, right.

pawn Код:
public OnPlayerText(playerid, text[])
{
    new textstring[128];
    format(textstring, sizeof(textstring), "%s", text);
    SendPlayerMessageToAll(playerid, textstring);
    return 0;
}
Not tested but It should work.

And....

To set the player color use -
pawn Код:
SetPlayerColor(playerid, COLOR_WHITE)
Example:
pawn Код:
public OnPlayerConnect(playerid)
{
 SetPlayerColor(playerid, COLOR_WHITE)
 return 1;
}
pawn Код:
#define COLOR_WHITE 0xFFFFFFAA



Re: Player names in colors - iStrow - 29.03.2012

ok i'm not that steaupid xd....thanks for color...not id in chat, i already solved that...i meant ID above player ingame....above his head where is health and Name_Name(1)...i just want it to be Name_Name


Re: Player names in colors - ReneG - 29.03.2012

You would add this under OnGameModeInit
pawn Код:
ShowPlayerMarkers(0);
ShowNameTags(0);
That deletes the default name tags, and makes it so no players see each other on the radar.
Now, we will need to re-create those tags and add them to the players with just the name. Add this somewhere in your script.
pawn Код:
new Text3D:name[MAX_PLAYERS];
stock ShowTag(playerid)
{
    new
        tag[50],
        nname[24];
    GetPlayerName(playerid,nname,sizeof(nname));
    format(tag,sizeof(tag),"%s",nname);
    name[playerid] = Create3DTextLabel(tag, 0xFFFFFFFF, 0,0,0, 30, 0, 1); // Creates the label
    Attach3DTextLabelToPlayer(name[playerid],playerid,0,0,2); // Attaches it to the player
    return 1;
}
Now that we made a stock, we need to make it so that once a player spawns they will have the new name tag on them ( without the playerid ).
pawn Код:
public OnPlayerSpawn(playerid)
{
    ShowTag(playerid);
    return 1;
}
This should work, however it has not been tested.


Re: Player names in colors - iStrow - 30.03.2012

that works but player name is too high and it is not showing healthbar and armour bar