30.04.2014, 21:06
So i know how to create a progress bar but i want to know how to make it load in like 30 seconds.
new ShowProgressBar[MAX_PLAYERS];
new ProgressTime[MAX_PLAYERS];
forward ShowProgress(playerid);
public ShowProgress(playerid)
{
// Display progress bar to show for player here
if(ProgressTime[playerid] > 0)
{
ProgressTime[playerid] --;
}
if(ProgressTime[playerid] < 1)
{
// Hide the progress bar text draw for player here
ProgressTime[playerid] = 0;
KillTimer(ShowProgressBar[playerid]);
}
return 1;
}
ProgressTime[playerid] = 30;
ShowProgressBar[playerid] = SetTimerEx("ShowProgress", 60000, true, "i", playerid);
No, i mean i want to make a /rob command so when you do /rob, you get a progress bar that load for 30sec.
|
To be completely honest with you, I've never attempted such a thing. But if I were to attempt it I'd start by creating a "Main timer". Once the main timer is called, it will create another timer that loops every second or so, updating the timer each loop.
So if I were you, I'd create the main timer of 31 second and the second timer inside the main timer that repeats every seconds, updating the progress bar. (If there's an easier way someone please correct me.) |
That is a very bad idea, only need one timer and no loop as done above.
|
Top of game mode:
pawn Код:
Where rest of public callbacks are: pawn Код:
pawn Код:
pawn Код:
|