Hey guys, I was playing and I just got this idea, and I'm coming here posting it for you
(progress bar indicates seconds)
(progress bar indicates seconds)
Code:
#include a_samp
#include progress
new Text:r_bottom;
new Text:r_hour;
new Text:r_edge;
new Text:r_edge2;
new Text:r_edge3;
new Bar:r_seconds;
public OnGameModeInit()
{
r_seconds = CreateProgressBar(548.00, 37.00, 76.50, 7.19, -1048321, 60.0);
r_bottom = TextDrawCreate(628.352600, 6.750000, "usebox");
TextDrawLetterSize(r_bottom, 0.000000, 2.988888);
TextDrawTextSize(r_bottom, 544.352844, 0.000000);
TextDrawAlignment(r_bottom, 1);
TextDrawColor(r_bottom, 0);
TextDrawUseBox(r_bottom, true);
TextDrawBoxColor(r_bottom, 102);
TextDrawSetShadow(r_bottom, 0);
TextDrawSetOutline(r_bottom, 0);
TextDrawFont(r_bottom, 0);
r_hour = TextDrawCreate(550.588134, 0.583346, "00:00");
TextDrawLetterSize(r_hour, 0.609529, 3.705832);
TextDrawAlignment(r_hour, 1);
TextDrawColor(r_hour, -1);
TextDrawSetShadow(r_hour, -1);
TextDrawSetOutline(r_hour, 0);
TextDrawBackgroundColor(r_hour, 51);
TextDrawFont(r_hour, 2);
TextDrawSetProportional(r_hour, 1);
r_edge = TextDrawCreate(546.352966, 1.750000, "LD_SPAC:white");
TextDrawLetterSize(r_edge, 0.000000, 0.000000);
TextDrawTextSize(r_edge, 80.470588, 2.916666);
TextDrawAlignment(r_edge, 1);
TextDrawColor(r_edge, 255);
TextDrawSetShadow(r_edge, 0);
TextDrawSetOutline(r_edge, 0);
TextDrawFont(r_edge, 4);
r_edge2 = TextDrawCreate(545.941223, 43.000000, "LD_SPAC:white");
TextDrawLetterSize(r_edge2, 0.000000, 0.000000);
TextDrawTextSize(r_edge2, 80.470588, 2.916666);
TextDrawAlignment(r_edge2, 1);
TextDrawColor(r_edge2, 255);
TextDrawSetShadow(r_edge2, 0);
TextDrawSetOutline(r_edge2, 0);
TextDrawFont(r_edge2, 4);
r_edge3 = TextDrawCreate(546.000061, 36.416671, "LD_SPAC:white");
TextDrawLetterSize(r_edge3, 0.000000, 0.000000);
TextDrawTextSize(r_edge3, 2.352943, 9.333333);
TextDrawAlignment(r_edge3, 1);
TextDrawColor(r_edge3, 255);
TextDrawSetShadow(r_edge3, 0);
TextDrawSetOutline(r_edge3, 0);
TextDrawFont(r_edge3, 4);
SetTimer("r_update", 500, true);
return true;
}
public OnPlayerSpawn(playerid)
{
clock(playerid);
return true;
}
forward r_update();
public r_update()
{
new string[10], hour, minutes, seconds;
gettime(hour, minutes, seconds);
format(string, sizeof string, "%02d:%02d", hour, minutes), TextDrawSetString(r_hour, string);
SetProgressBarValue(r_seconds, seconds), UpdateProgressBar(r_seconds);
}
stock clock(playerid)
{
ShowProgressBarForPlayer(playerid, r_seconds);
TextDrawShowForPlayer(playerid, r_bottom);
TextDrawShowForPlayer(playerid, r_hour);
TextDrawShowForPlayer(playerid, r_edge);
TextDrawShowForPlayer(playerid, r_edge2);
TextDrawShowForPlayer(playerid, r_edge3);
return true;
}