3DText label
#1

So I made a global variable.. new 3DTexteadLabel[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]);
Reply
#2

Show us the whole command and function where you destroy the player's text label.
Reply
#3

I guess you need to use a loop.
Reply
#4

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]
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)