How to make a Countdown timer in upper right corner - 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: How to make a Countdown timer in upper right corner (
/showthread.php?tid=398662)
How to make a Countdown timer in upper right corner -
HireMe - 10.12.2012
I am working on a TDM server and want to have a Countdown timer above my Armour and Health bars this is to show how long it takes till the competition finish.
I want it to show in the following format: Hours:Minutes:Seconds
I want it to work with the following script so i can show and start it with the command /startcompetition
Re: How to make a Countdown timer in upper right corner -
dr.lozer - 10.12.2012
you can do like this:
pawn Код:
new Countdown = -1,Timer1;
forward Countdownstart();
public Countdownstart()
{
Countdown --;
new string[128];
format(string,128,"%d~n~Seconds",Countdown);
GameTextForAll(playerid,string,1000,4);
if(Countdown == COMPETITIONTIME) {
GameTextForAll("Competition Finished!",1000,4);
KillTimer(Timer1);
Countdown = COMPETITIONTIME;
return 1;
}
Timer1 = SetTimer("CountdownStart",1000,0);
return 1;
}
CMD:startcountdown(playerid)
{
if(!IsPlayerAdmin(playerid)) return 0;
if(Countdown != COMPETITIONTIME) return SendclientMessage(playerid, -1,"ERROR: Countdown is already started");
Countdown = COMPETITIONTIME;
CountdownStart();
return 1;
}
Re: How to make a Countdown timer in upper right corner -
HireMe - 10.12.2012
Quote:
Originally Posted by dr.lozer
you can do like this:
pawn Код:
new Countdown = -1,Timer1;
forward Countdownstart();
public Countdownstart() { Countdown --; new string[128]; format(string,128,"%d~n~Seconds",Countdown); GameTextForAll(playerid,string,1000,4); if(Countdown == COMPETITIONTIME) { GameTextForAll("Competition Finished!",1000,4); KillTimer(Timer1); Countdown = COMPETITIONTIME; return 1; } Timer1 = SetTimer("CountdownStart",1000,0); return 1; }
CMD:startcountdown(playerid) { if(!IsPlayerAdmin(playerid)) return 0; if(Countdown != COMPETITIONTIME) return SendclientMessage(playerid, -1,"ERROR: Countdown is already started"); Countdown = COMPETITIONTIME; CountdownStart(); return 1; }
|
Yeah i know but how can i put it in the upper right corner like where normal the game times stands?
and is it possible to show in the following format: Hours:Minutes:Seconds
Re: How to make a Countdown timer in upper right corner -
dr.lozer - 10.12.2012
use textdraws to make the times stands and yeah it is posible