11.06.2014, 16:00
(
Последний раз редактировалось $Marco$; 11.06.2014 в 17:38.
)
Hello there,
I was making a custom "name" for people to take off the health bar if they want it, but for some reason I couldn't "delete" it.
Here is what I've done:
I will be really happy if anyone will tell my why the TextLabel is not deleting itself when i type /healthbars for the second time.
FURTHER EXPLANATION: [INCASE YOU DIDN'T UNDERSTAND]
When a player types in /healthbars it will remove his OWN healthbar (by hiding his nametag and placing a 3DTextLabel attached above his head) so when he want's to show his healthbar again he types /healthbars and his nametag shows itself again while the 3DTextLabel gets erased.
The problem I'm having:
When player with the ID 0 types /healthbars, it hides its health everything is good.
ID 1 now types /healthbars, it hides its health everything is good.
ID 0 now decides to show his health again so he re-types /healthbars and it shows his healthbar but ALSO the 3DTextLabel with his name which doesn't need to be there (It doesn't delete it for some reason).
TL
R:
It needs to create your own PERSONAL 3DTextLabel above your head and delete this own personal 3DTextLabel when you retype the CMD.
I was making a custom "name" for people to take off the health bar if they want it, but for some reason I couldn't "delete" it.
Here is what I've done:
pawn Код:
new HealthBars[MAX_PLAYERS];
CMD:healthbars(playerid)
{
new Text3D:PlayerID[MAX_PLAYERS];
if(HealthBars[playerid] == 1)
{
new string[25], Float:Xpos, Float:Ypos, Float:Zpos;
GetPlayerPos(playerid, Xpos, Ypos, Zpos);
PlayerID[playerid] = Create3DTextLabel(string, 0xFFFFFFFF, Xpos, Ypos, Zpos + 1.34, 20.0, 0);
Attach3DTextLabelToPlayer(PlayerID[playerid], playerid, 0.0, 0.0, 0.14);
HealthBars[playerid] = 1;
}
else
{
Delete3DTextLabel(PlayerID[playerid]); // THIS IS WHATS NOT DELETING
HealthBars[playerid] = 0;
return 1;
}
return 1;
}
I will be really happy if anyone will tell my why the TextLabel is not deleting itself when i type /healthbars for the second time.
FURTHER EXPLANATION: [INCASE YOU DIDN'T UNDERSTAND]
When a player types in /healthbars it will remove his OWN healthbar (by hiding his nametag and placing a 3DTextLabel attached above his head) so when he want's to show his healthbar again he types /healthbars and his nametag shows itself again while the 3DTextLabel gets erased.
The problem I'm having:
When player with the ID 0 types /healthbars, it hides its health everything is good.
ID 1 now types /healthbars, it hides its health everything is good.
ID 0 now decides to show his health again so he re-types /healthbars and it shows his healthbar but ALSO the 3DTextLabel with his name which doesn't need to be there (It doesn't delete it for some reason).
TL

It needs to create your own PERSONAL 3DTextLabel above your head and delete this own personal 3DTextLabel when you retype the CMD.