Labels on the Head Part 2
#1

The labels are now working perfectly fine, but this time the disappearing label passes on players.
For example, ID 0 doesn't have a label on his head, once he time out and relogs this problem will pass on ID 1 and so on.

I am not sure, I have tried someone's suggestion with the INVALID_3DTEXT_LABEL thing.
It is almost working except to this problem.

Here is my code.

PHP код:
new Text3D:Label[MAX_PLAYERS];
//OnGameModeInit
    
for(new x=0x<MAX_PLAYERSx++)
    {
        
Label[x] = Text3D:INVALID_3DTEXT_ID;
    }
//OnPlayerConnect
    
Label[playerid] = Create3DTextLabel("SWF", -10.00.00.07.00);
    
Attach3DTextLabelToPlayer(Label[playerid], playerid0.00.00.5);
//OnPlayerDisconnect
    
Delete3DTextLabel(Label[playerid]);
    
Label[playerid] = Text3D:INVALID_3DTEXT_ID;
//Other functions
Update3DTextLabelText(bahblah) - But i don't think this has something to do with it so yeah leave it like that 
Reply
#2

Bump...
Reply
#3

Quote:
Originally Posted by Forum Rules
Bumping a topic in which you have or require further information is allowed after at least 24 hours.
But i would suggest using a streamer with dynamic text labels.
Reply
#4

You can declare your array like that.
PHP код:
new 
    
Text3D:Label[MAX_PLAYERS] = {Text3D:INVALID_3DTEXT_ID, ...}; 
That way you don't have to use a loop in OnGameModeInit
Reply
#5

Do not use standard labels they bug out when attaching to the player happens every time! Use the streamer plugin and dynamic labels and you shouldn't have the same issues.
Reply
#6

well how am i gonna do that with streamer do i have to usr var for ipdating the labels?
Reply
#7

They work almost the same way.
Reply
#8

Quote:
Originally Posted by JaKe Elite
Посмотреть сообщение
well how am i gonna do that with streamer do i have to usr var for ipdating the labels?
Pretty much the same, just different names of the functions, but you can check them out on the topic:
https://sampforum.blast.hk/showthread.php?tid=102865
There's a list of all the functions, just use CTRL+F to search for the one you want, like "CreateDynamic", and you can easily find CreateDynamic3DTextLabel and it's parameters.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)