SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 01/02/2018, 07:13 AM   #1
nguyendinhdat
Little Clucker
 
Join Date: Apr 2017
Location: Viet Nam , City Da Nang
Posts: 10
Reputation: 0
Default Help Scripts . Error NameTags Player !!

Help me
Attached Images
File Type: jpg sa-mp-001.jpg (109.0 KB, 20 views)
nguyendinhdat is offline   Reply With Quote
Old 01/02/2018, 08:04 AM   #2
Flamehaze7
Big Clucker
 
Flamehaze7's Avatar
 
Join Date: Feb 2016
Posts: 111
Reputation: 10
Default Re: Help Scripts . Error NameTags Player !!

Provide code and we can try to help you
Flamehaze7 is offline   Reply With Quote
Old 01/02/2018, 08:20 AM   #3
nguyendinhdat
Little Clucker
 
Join Date: Apr 2017
Location: Viet Nam , City Da Nang
Posts: 10
Reputation: 0
Default Re: Help Scripts . Error NameTags Player !!

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);
nguyendinhdat is offline   Reply With Quote
Old 01/02/2018, 08:39 AM   #4
Flamehaze7
Big Clucker
 
Flamehaze7's Avatar
 
Join Date: Feb 2016
Posts: 111
Reputation: 10
Default Re: Help Scripts . Error NameTags Player !!

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)
http://wiki.sa-mp.com/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
Flamehaze7 is offline   Reply With Quote
Old 01/02/2018, 08:46 AM   #5
Sew_Sumi
Banned
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,298
Reputation: 525
Default Re: Help Scripts . Error NameTags Player !!

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.
Sew_Sumi is offline   Reply With Quote
Old 01/02/2018, 09:23 AM   #6
Mugala
Gangsta
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 743
Reputation: 33
Default Re: Help Scripts . Error NameTags Player !!

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.
__________________
here to help
Mugala is offline   Reply With Quote
Old 01/02/2018, 11:10 AM   #7
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Sweden
Posts: 2,285
Reputation: 161
Default Re: Help Scripts . Error NameTags Player !!

And if you using this in a cmd like mask you can just put this ShowNameTags(0); in the cmd aswell.
__________________
https://discord.gg/HyQQ8NV
N0FeaR is online now   Reply With Quote
Old 01/02/2018, 11:16 AM   #8
Mugala
Gangsta
 
Mugala's Avatar
 
Join Date: Nov 2012
Location: Georgia, Tbilisi
Posts: 743
Reputation: 33
Default Re: Help Scripts . Error NameTags Player !!

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 (http://wiki.sa-mp.com/wiki/ShowPlayerNameTagForPlayer)
__________________
here to help
Mugala is offline   Reply With Quote
Old 01/02/2018, 11:17 AM   #9
N0FeaR
High-roller
 
N0FeaR's Avatar
 
Join Date: Nov 2011
Location: Sweden
Posts: 2,285
Reputation: 161
Default Re: Help Scripts . Error NameTags Player !!

Quote:
Originally Posted by Mugalito View Post
this will disable whole server's name tags, use this - ShowPlayerNameTagForPlayer (http://wiki.sa-mp.com/wiki/ShowPlayerNameTagForPlayer)
Yeah i just realize that thanks for correct me.
__________________
https://discord.gg/HyQQ8NV
N0FeaR is online now   Reply With Quote
Old 01/02/2018, 11:17 AM   #10
Sew_Sumi
Banned
 
Join Date: Jun 2008
Location: Azerbaijan
Posts: 6,298
Reputation: 525
Default Re: Help Scripts . Error NameTags Player !!

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.
Sew_Sumi is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to make player nametags hide when they're crouched. rangerxxll Scripting Help 7 23/10/2015 08:37 AM
NameTags Gundogdu Scripting Help 4 04/05/2013 07:54 PM
if player in vehicle scripts nejc001 Help Archive 4 14/10/2010 06:00 PM
Using scripts for Single player... how? possible? Booster General 0 27/02/2009 03:04 PM


All times are GMT. The time now is 11:09 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.