Whats wrong with textdraws - 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: Whats wrong with textdraws (
/showthread.php?tid=665490)
Whats wrong with textdraws -
zowzow - 06.04.2019
I try to reset it everytime when I called textdraw to show up but no its still max value then reset to 0
This is how I used to show them
PHP Code:
CMD:test1(playerid, params[])
{
pInfo[playerid][pTextFloat] = 0.0;
WorkOn[playerid] = 1;
ShowFishTextdraw(playerid, 1); // Show progress bar normal
SCM(playerid, -1, "%.1f", pInfo[playerid][pTextFloat]);
return 1;
}
public SecondCount()
{
foreach (new i : Player)
{
if(WorkOn[i] == 1)
{
if(pInfo[i][pTextFloat] < MAX_VALUE)
{
// Normal bar
PlayerTextDrawTextSize(i, Textdraws[i][0],pInfo[i][pTextFloat], 14.0000);
PlayerTextDrawShow(i, Textdraws[i][0]);
// reset here
WorkOn[i] = 0;
pInfo[i][pTextFloat] = 0.0;
// Send to hide all textdraws
} else {
// Increase every 1 sec
PlayerTextDrawTextSize(i, Textdraws[i][0], pInfo[i][pTextFloat], 14.0000);
PlayerTextDrawShow(i, Textdraws[i][0]);
pInfo[i][pTextFloat] += 10.0;
}
}
}
return 1;
}
After hide all textdraw then I did /test1 again but its start from MAX_VALUE then reset to pTextFloat
So I lost 2 sec for reset and then get start from pTextFloat
Even my textdraw code from 0.0
PHP Code:
Textdraws[playerid][0] = CreatePlayerTextDraw(playerid, 267.066589, 218.151870, "LD_SPAC:white");
PlayerTextDrawLetterSize(playerid, Textdraws[playerid][0], 0.000000, 0.000000);
PlayerTextDrawTextSize(playerid, Textdraws[playerid][0], 0.000000, 14.029999); // 106.829963 = MAX_VALUE
PlayerTextDrawAlignment(playerid, Textdraws[playerid][0], 1);
PlayerTextDrawColor(playerid, Textdraws[playerid][0], 16711935);
PlayerTextDrawSetShadow(playerid, Textdraws[playerid][0], 0);
PlayerTextDrawSetOutline(playerid, Textdraws[playerid][0], 0);
PlayerTextDrawBackgroundColor(playerid, Textdraws[playerid][0], 255);
PlayerTextDrawFont(playerid, Textdraws[playerid][0], 4);
PlayerTextDrawSetProportional(playerid, Textdraws[playerid][0], 0);
PlayerTextDrawSetShadow(playerid, Textdraws[playerid][0], 0);