Timer Help again
#1

How to reset a timer.?
I mean, i have completed a countdown, and killed the timer. when i start the countdown again it runs in negative values!!
Reply
#2

show us your code
Reply
#3

Код:
new Countdown = 20;
new CountDownTimer;
forward Countdowntimer(playerid);

CountDownTimer= SetTimer("Countdowntimer", 999, true);

public Countdowntimer(playerid)
{
	Countdown--;
	new string[128];
  format(string, sizeof(string), "%d", Countdown);
  TextDrawSetString(cd, string);
  TextDrawShowForAll(cd);
  
  if(Countdown == 0)
  {
  new rand = random(sizeof(gRandomPlayerSpawns));
  ResetPlayerWeapons(playerid);
  KillTimer(CountDownTimer);
  TextDrawHideForAll(cd);
  TextDrawHideForAll(Textdraw4);
  Countdown = 20; // This is line where i reset the time seconds to 20 again. But it doesnt work
  }
}
Reply
#4

new string[2]; instead of string[128];
Reply
#5

Quote:
Originally Posted by _Saif_
new string[2]; instead of string[128];
It didnt work.
When i enter the checkpoint the time from 20 changed to 1 immediately
Reply
#6

then you done something wrong in your command in which the command starts
Reply
#7

but when i changed it to 3 and more it worked
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)