:3DTextLabel: Overlaps the previous one. - 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: :3DTextLabel: Overlaps the previous one. (
/showthread.php?tid=331936)
:3DTextLabel: Overlaps the previous one. -
HondaCBR - 06.04.2012
Basically time updates and when it gets down to 1, I want this (Tired) text to appear, but the problem is that it overlaps the previous text
(Tired|) Text
pawn Код:
if(PlayerInfo[playerid][pBWTime] <= 1)
{
TogglePlayerControllable(playerid, 1);
SetCameraBehindPlayer(playerid);
PlayerInfo[playerid][pBW] = 2;
PlayerInfo[playerid][pBWTime] = 0;
PlayerInfo[playerid][pBWTime2] = 2;
PlayerInfo[playerid][pIntBW] = 0;
PlayerInfo[playerid][pPos_xBW] = 0;
PlayerInfo[playerid][pPos_yBW] = 0;
PlayerInfo[playerid][pPos_zBW] = 0;
SetPlayerDrunkLevel(playerid, 5000);
TextDrawHideForPlayer(playerid,TextdrawBW);
PlayerTextDrawHide(playerid,TextdrawBW2[playerid]);
SetPlayerHealth(playerid, 20);
Delete3DTextLabel(pTextID[playerid]);
format(nameformat,sizeof(nameformat),"%s (%d)\n(Tired)",pName,playerid);
pTextID[playerid] = Create3DTextLabel(nameformat,COLOR_WHITE,X,Y,Z+0.13,15,0,0);
Update3DTextLabelText(pTextID[playerid],COLOR_WHITE,nameformat);
Attach3DTextLabelToPlayer(pTextID[playerid], playerid, 0.0, 0.0, 0.13);
Previous text
pawn Код:
Delete3DTextLabel(pTextID[playerid]);
format(nameformat,sizeof(nameformat),"%s (%d)\n(Sleeping, %dmin)",pName,playerid,PlayerInfo[playerid][pBWTime]);
pTextID[playerid] = Create3DTextLabel(nameformat,COLOR_WHITE,X,Y,Z+0.13,15,0,0);
Update3DTextLabelText(pTextID[playerid],COLOR_WHITE,nameformat);
Attach3DTextLabelToPlayer(pTextID[playerid], playerid, 0.0, 0.0, 0.13);
And also the sleeping time overlaps when updates, It starts on (Sleeping, 3) and then the 2 is on top of that 3, and then 1min comes on top of 2 and 3.
Any ideas how to stop it overlapping?