Issue with timer
#1

Command:
Код:
CMD:reqmed(playerid, params[])
{
	new string[64], option[4], item[5], amount[5];
	
	sscanf(params, "sss", option, item, amount);
	
	if(isnull(option))
	{
	    SendClientMessage(playerid, COLOR_GREY, "USAGE: /reqmed <optiune>");
	    SendClientMessage(playerid, COLOR_GREY, "OPTIUNI: brokenleg");
	    return 1;
	}
	if (!strcmp(option, "brokenleg"))
  	{
	    if(pLegBroken[playerid] == true)
	    {
	        SetPlayerPos(playerid, 1506.3864,-1530.9393,1971.8003);
	        TogglePlayerControllable(playerid, 0);
	        LoopingAnim(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
	        SendClientMessage(playerid, COLOR_GREEN, "Ai fost trimis in sala de operatie, te rugam sa astepti.");
			CountDownTimer = SetTimerEx("CountDown", 1000, false, "i", playerid);
		}
		else
		{
		    SendClientMessage(playerid, COLOR_GREY, "Nu ai picioarele ranite.");
		}
	}
  	return 1;
}
Timer:
Код:
forward CountDown(playerid);
public CountDown(playerid)
{
     CountDownVar--;
     new str[128];
     if(CountDownVar == 0)
     {
            KillTimer(CountDownTimer);
            CountDownVar = 4;
            if(pLegBroken[playerid] ==  true)
            {
                pLegBroken[playerid] = false;
                SendClientMessage(playerid, 0x33AA33AA, "> Ai fost eliberat din spital, piciorul tau este mai bine.");
				SetPlayerPos(playerid, 1502.5439,-1546.3174,1970.7870);
				TogglePlayerControllable(playerid, 1);
			}
     }
     else
     {
           format(str, sizeof(str), "Timp ramas in operatie: %d", CountDownTimer);
           GameTextForPlayer(playerid, str, 1000, 1);
     }
     return 1;
}
Why is the time raising instead of going down? From 40 it got to 370, I want it to go down from 50 seconds to zero...
Reply


Messages In This Thread
Issue with timer - by AndreiWow - 18.01.2017, 18:38
Re: Issue with timer - by Sew_Sumi - 18.01.2017, 19:10
Re: Issue with timer - by SyS - 19.01.2017, 00:43
Re: Issue with timer - by Nate4 - 19.01.2017, 04:06
Re: Issue with timer - by Sew_Sumi - 19.01.2017, 05:34
Re: Issue with timer - by AndreiWow - 19.01.2017, 10:36

Forum Jump:


Users browsing this thread: 1 Guest(s)