[Ajuda] Textdraw 0% б 100% - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: Non-English (
https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (
https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (
https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Textdraw 0% б 100% (
/showthread.php?tid=661897)
Textdraw 0% б 100% -
GasparzinhoXD - 18.12.2018
E aн pessoal, eu criei um tуpico dizendo que estava com problema com uma barra de load que criei, mas ai eu recriei o cуdigo novamente e consegui resolver o problema do timer. Ai eu tive a ideia de criar uma textdraw que vai de 0% б 100% mas eu nгo faзo a minima de como fazer a textdraw vб de 0% б 100% sem pular nenhum nъmero e terminar junto com o load, quando a box carregar toda. Eu jб tentei diversas vezes e nгo consegui, jб tentei dividir, tentei de tudo, em fim... vou deixar o cуdigo a baixo pra tentar facilitar quem quiser me ajuda.
PHP код:
public LoadBarraLogin(playerid)
{
new str[128], varLoad[MAX_PLAYERS];
if(varBarra[playerid] != 301)
{
varBarra[playerid] ++;
TimerLoadTela[playerid] = SetTimerEx("LoadBarraLogin", 500, false, "i", playerid);
}
if(varBarra[playerid] == 301)
{
KillTimer(TimerLoadTela[playerid]);
SetPlayerPos(playerid, 1351.1379,-752.7781,120.4901);
InterpolateCameraPos(playerid, 1354.094970, -766.179077, 100.637901, 1354.094970, -766.179077, 100.637901, 1000);
InterpolateCameraLookAt(playerid, 1353.289306, -770.835693, 102.270904, 1353.289306, -770.835693, 102.270904, 1000);
}
format(str, 100, "%d%", varLoad[playerid]);
PlayerTextDrawSetString(playerid, ProgressBar[playerid][2], str); // Essa й a Textdraw que deve ir de 0% б 100%
PlayerTextDrawTextSize(playerid, ProgressBar[playerid][1], 177+varBarra[playerid], 1.0 );
PlayerTextDrawShow(playerid, ProgressBar[playerid][1]);
return 1;
}
Re: Textdraw 0% б 100% -
Paulthaz - 18.12.2018
Tenta isso
Код:
public LoadBarraLogin(playerid)
{
new str[128];
if(varBarra[playerid] != 100)
{
varBarra[playerid] ++;
TimerLoadTela[playerid] = SetTimerEx("LoadBarraLogin", 500, false, "i", playerid);
}
if(varBarra[playerid] == 100)
{
KillTimer(TimerLoadTela[playerid]);
SetPlayerPos(playerid, 1351.1379,-752.7781,120.4901);
InterpolateCameraPos(playerid, 1354.094970, -766.179077, 100.637901, 1354.094970, -766.179077, 100.637901, 1000);
InterpolateCameraLookAt(playerid, 1353.289306, -770.835693, 102.270904, 1353.289306, -770.835693, 102.270904, 1000);
}
format(str, 100, "%d%", varBarra[playerid]);
PlayerTextDrawSetString(playerid, ProgressBar[playerid][2], str);
PlayerTextDrawTextSize(playerid, ProgressBar[playerid][1], 418*(varBarra[playerid]/100), 1.0 );
PlayerTextDrawShow(playerid, ProgressBar[playerid][1]);
return 1;
}
Re: Textdraw 0% б 100% -
GasparzinhoXD - 18.12.2018
Bugou a progress bar do load, a textdraw que vai de 0% б 100% й essa ProgressBar[playerid][2] a de cima.Vou deixar especificado lб no cуdigo
Re: Textdraw 0% б 100% -
Paulthaz - 18.12.2018
adc discord Yoshi#0596