Adding a new name tag... - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Adding a new name tag... (
/showthread.php?tid=170659)
Adding a new name tag... -
Scenario - 23.08.2010
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!
Re: Adding a new name tag... -
playbox12 - 23.08.2010
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
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.
Re: Adding a new name tag... -
Scenario - 23.08.2010
I know it isn't hard, I just can't think of the correct way for some odd reason.
Re: Adding a new name tag... -
Scenario - 23.08.2010
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...