How to make a Countdown timer in upper right corner
#1

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
Reply
#2

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;
}
Reply
#3

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
Reply
#4

use textdraws to make the times stands and yeah it is posible
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)