Function Bug
#1

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;
}

How can i script a function to erase this gamemodetext count?
Thanks to all replies,
Rodri.
Rodri99 is online now Add to Rodri99's Reputation Report Post
Reply
#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


Forum Jump:


Users browsing this thread: 2 Guest(s)