13.05.2018, 01:44
good, the "progress bar" created, when you reach the limit, instead of starting and starting all over again, it keeps loading, thus overtaking the boundary edge of the textdraw, wanted it to arrive at the edge and the green color ( which is "loading") returns from "0" and starts all over again.
Can someone help me ?
Quote:
#include <a_samp> #include <ZCMD> #include <DOF2> #define FILTERSCRIPT #if defined FILTERSCRIPT #define speed 100 new Text:UP[2]; public OnFilterScriptInit() { UP[0] = TextDrawCreate(521.500000, 103.511054, "box"); //fundo preto TextDrawLetterSize(UP[0], 0.000000, 1.200000); TextDrawTextSize(UP[0], 607.000000, 0.000000); TextDrawUseBox(UP[0], 1); TextDrawBoxColor(UP[0], 255); UP[1] = TextDrawCreate(523.299743, 105.188781, "box"); //verde TextDrawLetterSize(UP[1], 0.000000, 0.807000); TextDrawTextSize(UP[1], 604.999755, 0.000000); TextDrawUseBox(UP[1], 1); TextDrawBoxColor(UP[1], 9765119); return 1; } public OnFilterScriptExit() { DOF2_Exit(); return 1; } forward ProgressBar(playerid); public ProgressBar(playerid) { static Float: Progress; TextDrawTextSize(UP[1], (523.299743 + ((81.700012 * ++Progress) / speed)),0.0); TextDrawShowForPlayer(playerid, UP[1]); TextDrawBoxColor(UP[1], 9765119); if(Progress < speed) SetTimerEx("ProgressBar", speed, false, "i", playerid); return 1; } public OnPlayerConnect(playerid) { SetTimerEx("ProgressBar", speed, true, "i", playerid); return 1; } public OnPlayerSpawn(playerid) { TextDrawHideForPlayer(playerid, UP[0]); TextDrawHideForPlayer(playerid, UP[1]); return 1; } #endif |