Names with 3D Text Labels change?!
#1

Hi all...

I'm wondering why sometimes the names made with 3D Text Label, sometimes overlap and change...
Example:

Player1 has Player2 name, but Player2 has Player1 name overlapped to his name.

Here's the code.
pawn Код:
//On top
#define NAME_DRAWDISTANCE (5)
new Text3D:NameTag[MAX_PLAYERS];
//OnPlayerDisconnect
Delete3DTextLabel( NameTag[playerid] );
//OnPlayerConnect
playerName = p_name( playerid );
    NameTag[playerid] = Create3DTextLabel(playerName, 0xFFFFFFFF, 0, 0, 0, NAME_DRAWDISTANCE, 0, 1 );
    Attach3DTextLabelToPlayer(NameTag[playerid], playerid, 0.0, 0.0, 0.2);
//OnGameModeInit
 SetNameTagDrawDistance(0.0);
    ShowNameTags(false);
Thanks.
Reply
#2

Only thing I could think of is that your p_name function returns the wrong name. Use:

pawn Код:
GetPlayerName(playerid, playerName, sizeof(playerName));

Also it could be that you would be better off using a different name variable for each person, so an array:

pawn Код:
new playerName[MAX_PLAYERS][24];
GetPlayerName(playerid, playerName[playerid], sizeof(playerName[playerid]));
Reply
#3

Thanks, it resolved that. REP+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)