Static 3D Texts
#1

Hey, so I've been experiencing that weird 3D text labels bug - random player IDs, that are not even using a mask get assigned a label ID and it covers their original name-tag as if the label wasn't deleted properly beforehand for the previous player using that ID? However, I can't seem to find the issue myself, therefore, decided to request help here.


The Issue
Player ID 40 leaves and another player takes the same ID, this happens randomly.

(Static 3DText Labels Used ^)
Defining
PHP код:
new Text3DMaskLabel[MAX_PLAYERS]  = {Text3D:-1, ...}; 
Deleting
PHP код:
if(MaskLabel[playerid] != Text3D: -1)
{
  
Delete3DTextLabel(MaskLabel[playerid]);
  
MaskLabel[playerid] = Text3D: -1;
}
// Labels are getting deleted on:
// OnGameModeExit
// OnPlayerDisconnect
// BEFORE Creation
// Whenever the player's mask is removed by any function 
Creating
PHP код:
if(MaskLabel[playerid] != Text3D: -1)
{
   
Delete3DTextLabel(MaskLabel[playerid]);
   
MaskLabel[playerid] = Text3D: -1;
}
// Checking if there's a valid label, if yes, it's getting deleted before creation
format(stringsizeof(string), "Mask_%d"MaskID[playerid]);
MaskLabel[playerid] = Create3DTextLabel(string, -1000601);
Attach3DTextLabelToPlayer(MaskLabel[playerid], playerid0.00.00.25); 
Reply
#2

You could try switching over to streamer labels, I've also had issues with deleting labels properly when not using the dynamic ones, although I never attached mine to players.

https://github.com/samp-incognito/sa...D-Text-Labels))
Reply
#3

I had the same issue when i used to run a server, I couldn't find a way to fix it, It was messing up with other player name, what i did was just removing it and went back to the default nametag.
Reply
#4

@Chyakka - Yeah, well, I can't really say that dynamic labels work for me. I remember trying them out before and there were even more wild bugs appearing out of nowhere, e.g: double labels on top of each-other and so on, including the bug I'm experiencing now LOL.

@ConnorW - I think I have actually figured it out, the labels weren't properly deleted right after a player enters death mode (custom system). Instead, they were deleted on spawn, which means that if the player leaves the server while in death mode, that ID will still have the label attached to them unless they mask and unmask themselves afterwards. It also seems like I was lacking the required code under OnPlayerDisconnect to prevent that.

Thank you both for your replies and for helping brainstorm this together, I'll make sure to rep you both.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)