Dynamic 3D Texts not appearing
#1

Hello.
I have a problem - after some time (30-60+ minutes?) some dynamic 3d text labels are simply not appearing for whatever reason. They work fine in the first minutes after launching a server but after some time they are nowhere to be seen. Here's the code:

PHP код:
new Text3D:Info3DText[MAX_PLAYERS]; // top of the gamemode
if(IsValidDynamic3DTextLabel(Info3DText[playerid])) DestroyDynamic3DTextLabel(Info3DText[playerid]); // OnPlayerConnnect
Info3DText[playerid] = CreateDynamic3DTextLabel(strInfoText0xFF9900BB0.00.00.4510playeridINVALID_VEHICLE_ID1); // OnPlayerConnnect
if(IsValidDynamic3DTextLabel(Info3DText[playerid])) DestroyDynamic3DTextLabel(Info3DText[playerid]); // OnPlayerDisconnect 
The string is not the problem.
Reply
#2

The issue here is that you never reset the value of 'Info3DText[playerid]'. Just because you use it in DestroyDynamic3DTextLabel, doesn't mean the value changes.

Example:
PHP код:
// OnPlayerDisconnect
if(IsValidDynamic3DTextLabel(Info3DText[playerid]))
{
    
DestroyDynamic3DTextLabel(Info3DText[playerid]);
    
Info3DText[playerid] = -1;

So when the next player connects, 'Info3DText[playerid]' will still be a valid 3d label ID. So it will end up destroying someone else's text label.
Reply
#3

It spews out 'tag mismatch' warnings now, should I just ignore it?
Reply
#4

Sorry, my bad. I make a lot of mistakes on my phone for some reason.

PHP код:
Info3DText[playerid] = Text3D:-1
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)