SA-MP Forums Archive
Labels on the Head Part 2 - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Labels on the Head Part 2 (/showthread.php?tid=568899)



Labels on the Head Part 2 - JaKe Elite - 26.03.2015

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 



Re: Labels on the Head Part 2 - JaKe Elite - 26.03.2015

Bump...


Re: Labels on the Head Part 2 - CalvinC - 26.03.2015

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.


Re : Labels on the Head Part 2 - Dutheil - 26.03.2015

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


Re: Labels on the Head Part 2 - Pottus - 26.03.2015

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.


Re: Labels on the Head Part 2 - JaKe Elite - 26.03.2015

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


Re: Labels on the Head Part 2 - Pottus - 26.03.2015

They work almost the same way.


Re: Labels on the Head Part 2 - CalvinC - 26.03.2015

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.