3DText label - 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: 3DText label (
/showthread.php?tid=556146)
3DText label -
PaulDinam - 09.01.2015
So I made a global variable.. new 3DText
eadLabel[MAX_PLAYERS];
I created a new 3DText label and attached it to the player's head so everyone could see it.
There's one little problem, when I destroy someone elses DeadLabel it destroys everyone's label. My code is completely fine.
Creating the label:
pawn Код:
DeadLabel[playerid] = Create3DTextLabel("(( This player is dead ))", -1, 0.0, 0.0, 0.0, 7.0, 0);
Attach3DTextLabelToPlayer(DeadLabel[playerid], playerid, 0.0, 0.0, 0.5);
Destroying the label:
pawn Код:
Delete3DTextLabel(DeadLabel[playerid]);
Re: 3DText label -
Divergent - 10.01.2015
Show us the whole command and function where you destroy the player's text label.
Re: 3DText label -
Wizzy951 - 10.01.2015
I guess you need to use a loop.
Re: 3DText label -
iiNzTicTx - 10.01.2015
Yeah, further code would be needed, it's not a problem with labels, but the actual code itself. Perhaps you have a loop going that it destroys all players, rather than just one, or the function/callback you have it under is.
I presume you have:
pawn Код:
Delete3DTextLabel(DeadLabel[playerid])
Under OnPlayerSpawn?
Well around there, I presume the bug would be occurring, have you detected if the player had just died?
[edited this post, couldn't delete it so mose well post]