18.02.2015, 18:18
Okay so I got this problem with these custom nametags that I made, they don't work, sometimes they do and sometimes they don't, it's like another player's nametag gets placed on somebody elses nametag and then it shows it like this.
I have no idea what could be causing this, I'll show you the full code of the nametag system and you look at it, I really need help with this, it is messing my server.
I found this, pottus had commented on a thread similiar to my problem saying
Quote from Pottus: This is a pretty common issue when attaching 3d labels they bug out for some reason I would suggest using the streamer to handle 3d labels there is another thing you could try as well that is after you delete a label set it to INVALID_3DTEXT_ID then before creating make sure that the variable is INVALID_3DTEXT_ID if not delete it.
I didn't understand anything so I hope you can.
I have no idea what could be causing this, I'll show you the full code of the nametag system and you look at it, I really need help with this, it is messing my server.
pawn Код:
#define NAME_DRAWDISTANCE (5) // The distance of the 3d text nametags to appear.
new Text3D:NameTag[MAX_PLAYERS]; // The variable of the nametag.
// I put these two on the top of the script.
SetNameTagDrawDistance(0.0);
ShowNameTags(false);
// I put this under OnGameModeInit to hide the original nametags.
new playerName;
playerName = RemoveUnderScore(playerid);
NameTag[playerid] = Create3DTextLabel(playerName, 0xFFFFFFFF, 0, 0, 0, NAME_DRAWDISTANCE, 0, 1);
Attach3DTextLabelToPlayer(NameTag[playerid], playerid, 0.0, 0.0, 0.2);
// I put this OnPlayerConnect where the player officialy gets the nametag placed above his head.
Delete3DTextLabel(NameTag[playerid]);
// I put this under OnPlayerDisconnect to delete the nametag from his head because he disconnects.
Quote from Pottus: This is a pretty common issue when attaching 3d labels they bug out for some reason I would suggest using the streamer to handle 3d labels there is another thing you could try as well that is after you delete a label set it to INVALID_3DTEXT_ID then before creating make sure that the variable is INVALID_3DTEXT_ID if not delete it.
I didn't understand anything so I hope you can.