Some help with timer
#1

I want the timer to be killed first and then set a new timer
PS: It is used for teleport messages.
Код:
stock SendBoxMsg(string[])
{
   if(CurrentMsg == 0)
   {
	 TextDrawShowForAll(box0);
	 TextDrawSetString(box0,string);
	 KillTimer(box0tdtimer);
     box0tdtimer = SetTimer("box0td", 10000, true);
     CurrentMsg++;
   }
   else if(CurrentMsg == 1)
   {
     TextDrawShowForAll(box1);
	 TextDrawSetString(box1,string);
	 KillTimer(box1tdtimer);
	 box1tdtimer = SetTimer("box1td", 10000, true);
	 CurrentMsg++;
   }
   else if(CurrentMsg == 2)
   {
     TextDrawShowForAll(box2);
	 TextDrawSetString(box2,string);
	 KillTimer(box2tdtimer);
	 box2tdtimer = SetTimer("box2td", 10000, true);
	 CurrentMsg = 0;
}
  	else if(CurrentMsg >= 3)
   {
	 CurrentMsg = 0;
   }
}
Код:
forward box0td(playerid);
public box0td(playerid)
{
    TextDrawHideForAll(box0);
    CurrentMsg = 0;
}
forward box1td(playerid);
public box1td(playerid)
{
    TextDrawHideForAll(box1);
    CurrentMsg = 0;
}
forward box2td(playerid);
public box2td(playerid)
{
    TextDrawHideForAll(box2);
}
Reply


Messages In This Thread
Some help with timer - by fireranger11 - 11.06.2017, 22:37
Re: Some help with timer - by Sew_Sumi - 11.06.2017, 22:43
Re: Some help with timer - by fireranger11 - 11.06.2017, 22:45
Re: Some help with timer - by fireranger11 - 11.06.2017, 22:47
Re: Some help with timer - by Sew_Sumi - 11.06.2017, 23:10
Re: Some help with timer - by fireranger11 - 11.06.2017, 23:17
Re: Some help with timer - by Sew_Sumi - 11.06.2017, 23:23
Re: Some help with timer - by fireranger11 - 11.06.2017, 23:25
Re: Some help with timer - by Sew_Sumi - 11.06.2017, 23:32
Re: Some help with timer - by fireranger11 - 11.06.2017, 23:39

Forum Jump:


Users browsing this thread: 2 Guest(s)