13.10.2018, 07:28
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 ^)
DefiningThe Issue
Player ID 40 leaves and another player takes the same ID, this happens randomly.
(Static 3DText Labels Used ^)
PHP код:
new Text3D: MaskLabel[MAX_PLAYERS] = {Text3D:-1, ...};
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
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(string, sizeof(string), "Mask_%d", MaskID[playerid]);
MaskLabel[playerid] = Create3DTextLabel(string, -1, 0, 0, 0, 6, 0, 1);
Attach3DTextLabelToPlayer(MaskLabel[playerid], playerid, 0.0, 0.0, 0.25);