Function Bug
#2

Use [+code+] [/code] to add code in your thread (Remove the + from the tag)

Код:
forward countdownforddo(playerid);
public countdownforddo(playerid)
{
      if(CountDown==71) GameTextForPlayer(playerid,"~y~Starting...",1000,1 );

      CountDown--;
      if(CountDown==0)
      {
            GameTextForPlayer(playerid,"~r~YOU LOSE!",1000,1);
            CountDown = -1;
            return 0;
      }
      else
      {
           new text[7]; format(text,sizeof(text),"~g~%d",CountDown);
           GameTextForPlayer(playerid,text,1000,1);
      }

       SetTimer("countdownforddo",1000,0);
       return 0;
}
I am guessing that you want to stop the countdown.

Instead of creating a timer every one second, create one timer for the whole process.

Код:
timerid = SetTimer("countdownforddo",1000,true);
Make a global variable timerid and start the timer using the code given above when you want to start.

Then use KillTimer(timerid); to stop the countdown
Reply


Messages In This Thread
Function Bug - by Rodri99 - 31.05.2015, 09:50
Re: Function Bug - by Yashas - 31.05.2015, 11:12

Forum Jump:


Users browsing this thread: 1 Guest(s)