[Help]: CreateDynamic3DTextLabel BUG - 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: [Help]: CreateDynamic3DTextLabel BUG (
/showthread.php?tid=582302)
[Help]: CreateDynamic3DTextLabel BUG -
INKISICION - 19.07.2015
Hello everyone
I do not know why this happens, bug texts remain and some users have more than one text in the head
If you can help please
My Code
PHP код:
new Text3D:TextUser[MAX_PLAYERS];
//In Disconnect & OnplayerDeath
DestroyDynamic3DTextLabel(TextUser[playerid]);
public OnPlayerSpawn(playerid)
{
// Create 3D label
TextUser[playerid] = CreateDynamic3DTextLabel("",-1,0.0, 0.0, 0.52,8.0,playerid);
//Info Text Label Update
new Byt[80],RankVip[20];
switch(PlayerInfo[playerid][Vip])
{
case 0: RankVip = "{FF8040}No";
case 1: RankVip = "{00FF80}Lvl 1";
case 2: RankVip = "{00FF40}Lvl 2";
}
format(Byt,sizeof(Byt),"RankVip: %s\nLevel: %d\nHeadShoots: %d",RankVip,PlayerInfo[playerid][LevelUp],PlayerInfo[playerid][Hs]);
UpdateDynamic3DTextLabelText(TextUser[playerid],0x808080FF,Byt);
return 1;
}
AW: [Help]: CreateDynamic3DTextLabel BUG -
Mencent - 19.07.2015
Hello!
If the players spawn more than one times, the player have also more than one labels above the head.
So, you should set the label maybe 2 seconds later after the spawn (with a timer).
- Mencent
Re: [Help]: CreateDynamic3DTextLabel BUG -
INKISICION - 19.07.2015
Thanks
Re: [Help]: CreateDynamic3DTextLabel BUG -
Glenn332 - 19.07.2015
Make a variable that checks if the player has a textlabel yes or no.
Re: [Help]: CreateDynamic3DTextLabel BUG -
INKISICION - 19.07.2015
Quote:
Originally Posted by Glenn332
Make a variable that checks if the player has a textlabel yes or no.
|
Could you give me an example?
Re: [Help]: CreateDynamic3DTextLabel BUG -
Glenn332 - 19.07.2015
PHP код:
if(GetPVarInt(playerid, "LabelAdded") == 1)return 1;
SetPVarInt(playerid,"LabelAdded", 1);
Add these two lines before you create the label
Re: [Help]: CreateDynamic3DTextLabel BUG -
INKISICION - 19.07.2015
Quote:
Originally Posted by Glenn332
PHP код:
if(GetPVarInt(playerid, "LabelAdded") == 1)return 1;
SetPVarInt(playerid,"LabelAdded", 1);
Add these two lines before you create the label
|
So it should be?
PHP код:
PlayerSpawn(playerid)
{
if(GetPVarInt(playerid, "LabelAdded") == 1)return 1;
SetPVarInt(playerid,"LabelAdded", 1);
TextUser[playerid] = CreateDynamic3DTextLabel("",-1,0.0, 0.0, 0.52,8.0,playerid);
return 1;
}
Re: [Help]: CreateDynamic3DTextLabel BUG -
Glenn332 - 19.07.2015
Quote:
Originally Posted by INKISICION
So it should be?
PHP код:
PlayerSpawn(playerid)
{
if(GetPVarInt(playerid, "LabelAdded") == 1)return 1;
SetPVarInt(playerid,"LabelAdded", 1);
TextUser[playerid] = CreateDynamic3DTextLabel("",-1,0.0, 0.0, 0.52,8.0,playerid);
return 1;
}
|
Yes.
Re: [Help]: CreateDynamic3DTextLabel BUG -
INKISICION - 19.07.2015
Quote:
Originally Posted by Glenn332
Yes.
|
+ Respect For your help
Re: [Help]: CreateDynamic3DTextLabel BUG -
Glenn332 - 19.07.2015
Quote:
Originally Posted by INKISICION
+ Respect For your help
|
Thanks bud