Textdraw Countdown
#3

Try this .

Code:
new CTimer[MAX_PLAYERS] = 0;
new CountDownTime[MAX_PLAYERS] = 0;

stock CountDown(playerid, time)
{
	CountDownTime[playerid] = time;
	CTimer[playerid] = SetTimerEx("CountDownTimer", 1000, false, "i", playerid);
	return 0;
}

forward CountDownTimer(playerid);
public CountDownTimer(playerid)
{
	if(CountDownTime[playerid] > 1)
	{
		new timer[28];
		format(timer, sizeof(timer), "%i Seconds", CountDownTime[playerid]);
		GameTextForPlayer(playerid, timer, 1000, 0);
		CountDownTime[playerid] -= 1;
		return 1;
	}
	else
	{
		GameTextForPlayer(playerid, "GOOOOO!!!!", 1000, 0);
		KillTimer(CTimer[playerid]);
	}
	return 1;
}
Now all you have to do to make a timer that counts down is use:
Code:
CountDown(playerid, *the time you want in seconds*);
Reply


Messages In This Thread
Textdraw Countdown - by HerBan - 25.07.2014, 22:17
Re: Textdraw Countdown - by Virtual1ty - 25.07.2014, 22:26
Re: Textdraw Countdown - by Blademaster680 - 26.07.2014, 00:30

Forum Jump:


Users browsing this thread: 1 Guest(s)