SA-MP Forums Archive
Help Scripts . Error NameTags Player !! - 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: Help Scripts . Error NameTags Player !! (/showthread.php?tid=649003)



Help Scripts . Error NameTags Player !! - nguyendinhdat - 01.02.2018

Help me


Re: Help Scripts . Error NameTags Player !! - Flamehaze7 - 01.02.2018

Provide code and we can try to help you


Re: Help Scripts . Error NameTags Player !! - nguyendinhdat - 01.02.2018

format(string,sizeof(string),"%s (%d)",playerName,playerid);
PlayerNames[11][playerid] = Create3DTextLabel(string, 0xFFFFFFFF, 0, 0, 0, NAME_DRAWDISTANCE, 0, 1 );
Attach3DTextLabelToPlayer(PlayerNames[11][playerid], playerid, 0.0, 0.0, 0.2);
Update3DTextLabelText(PlayerNames[11][playerid], 0xFFFFFFFF, string);
SetPlayerColor(playerid,TEAM_HIT_COLOR);


Re: Help Scripts . Error NameTags Player !! - Flamehaze7 - 01.02.2018

Code:
CreatePlayer3DTextLabel(playerid, text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance, attachedplayer, attachedvehicle, testLOS)
Code:
Attach3DTextLabelToPlayer(Text3D:id, playerid, Float:OffsetX, Float:OffsetY, Float:OffsetZ)
https://sampwiki.blast.hk/wiki/CreatePlayer3DTextLabel

You should be using this instead of Create3DTextLabel and you need to change the Z axis (if i'm not wrong) to make the text show above your name


Re: Help Scripts . Error NameTags Player !! - Sew_Sumi - 01.02.2018

If you read his code Flamehaze7, he's already got that...

You need to disable the player nametags, before trying to do something like this.


Re: Help Scripts . Error NameTags Player !! - Mugala - 01.02.2018

Quote:
Originally Posted by Sew_Sumi
View Post
You need to disable the player nametags, before trying to do something like this.
like he said, u need to remove default nametags, u can do it with ShowNameTags(0); by placing it in OnGameModeInIt

also make sure when player disconnects, this 3dtextlabel is removed.


Re: Help Scripts . Error NameTags Player !! - N0FeaR - 01.02.2018

And if you using this in a cmd like mask you can just put this ShowNameTags(0); in the cmd aswell.


Re: Help Scripts . Error NameTags Player !! - Mugala - 01.02.2018

Quote:
Originally Posted by N0FeaR
View Post
And if you using this in a cmd like mask you can just put this ShowNameTags(0); in the cmd aswell.
this will disable whole server's name tags, use this - ShowPlayerNameTagForPlayer (https://sampwiki.blast.hk/wiki/ShowPlayerNameTagForPlayer)


Re: Help Scripts . Error NameTags Player !! - N0FeaR - 01.02.2018

Quote:
Originally Posted by Mugalito
View Post
this will disable whole server's name tags, use this - ShowPlayerNameTagForPlayer (https://sampwiki.blast.hk/wiki/ShowPlayerNameTagForPlayer)
Yeah i just realize that thanks for correct me.


Re: Help Scripts . Error NameTags Player !! - Sew_Sumi - 01.02.2018

Quote:
Originally Posted by N0FeaR
View Post
And if you using this in a cmd like mask you can just put this ShowNameTags(0); in the cmd aswell.
Incorrect.

Quote:

This function can only be used in OnGameModeInit. For other times, see ShowPlayerNameTagForPlayer.