3DLabelText - 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: 3DLabelText (
/showthread.php?tid=510661)
3DLabelText -
DemME - 01.05.2014
Hey guys, so I used this tutorial
https://sampforum.blast.hk/showthread.php?tid=468638 to add this feature to my server, now the problem is that everytime the text disappear, but the thing is I wanna know how to fix that it will not disappear ( for some players ) and to know how to add the player's ID byside the name.
COPY OF THE WHOLE FEATURE :
Код:
#include <a_samp>
#define NAME_DRAWDISTANCE (5) // The distance of the 3d text nametags to appear.
new Text3D:NameTag[MAX_PLAYERS];
new playerName[MAX_PLAYER_NAME];
public OnGameModeInit()
{
SetNameTagDrawDistance(0.0);
ShowNameTags(false);
return 1;
}
public OnPlayerConnect(playerid)
{
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);
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
Delete3DTextLabel( NameTag[playerid] );
return 1;
}
stock p_name( playerid )
{
new p_namev[MAX_PLAYER_NAME];
GetPlayerName(playerid, p_namev, MAX_PLAYER_NAME);
return p_namev;
}
Re: 3DLabelText -
DemME - 02.05.2014
bump, please..
Re: 3DLabelText -
mrtms - 02.05.2014
Now this is just a guess, but can't you do this?
Replace:
playerName = p_name( playerid );
With:
format(playerName, sizeof(playerName), "%s (%d)", p_name( playerid ), playerid);
That should display the players name and the id
Re: 3DLabelText -
XK - 02.05.2014
Yea as mrtms said ,do the thing he told you to get the id, and it migt be a bug somewhere,because the textdraw shouldnt disappear