Adding a new name tag...
#1

I know this is really easy, but I just can't seem to get it done. (I'm probably over thinking it)

I want to remove the name tag and all the stuff above a players head, and then use a 3DText to add the name of the player, rather then having the armor and health levels being shown as well. I already know this function;

pawn Код:
native SetNameTagDrawDistance
But how would I go about adding the 3DText with the players name above their head?

Thanks!
Reply
#2

Its not that hard, I don't have time at this moment. But maybe I can make it for you, you have my msn bother me sometime. :P

Edit: I will give you an example then:

Under OnGameModeInit you put

pawn Код:
ShowNameTags( 0 );
And for the player text in text label you put

pawn Код:
GetPlayerName( playerid, Name, sizeof( Name ) );
label[playerid] = Create3DTextLabel("%s",0x008080FF,30.0,40.0,50.0,40.0,0, Name);
Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
Something like that, I feel like I forgot something, its late. Goodluck with it.
Reply
#3

I know it isn't hard, I just can't think of the correct way for some odd reason.
Reply
#4

Okay, this is what I now have under "OnPlayerConnect"...

pawn Код:
new name[MAX_PLAYER_NAME], string[50];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s", name);
Create3DTextLabel(string, COLOR_WARNING, 0.0, 0.0, 0.0, 50.0, -1);
yet the name tags won't show up...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)