need help with timer.. lol
#6

Код:
// top of the script.

new counter=10;

// at forwards.

forward CountDown(playerid);
forward RestartServerCasovac()

// at OnGameModeInit.

SetTimer("RestartServerCasovac",1000,1);

// at public functions.

public RestartServerCasovac()
{
	new Hour, Minute, Second;
	gettime(Hour, Minute, Second);
	if(Hour == 3 && Minute == 0 && Second == 0)
	{
		SetTimer("CountDown",1000,1);
	}
	return 1;
}

public CountDown(playerid)
{
	new string[256];
	counter -= 1;
	format(string,sizeof(string),"Server Restarts in %d seconds!", counter);
	GameTextForAll(string,1000,3);
	if(counter == 0)
	{
		// here your restart server function.
	}
}
Reply


Messages In This Thread
need help with timer.. lol - by max007 - 04.01.2009, 11:35
Re: need help with timer.. lol - by Serbish - 04.01.2009, 12:07
Re: need help with timer.. lol - by max007 - 04.01.2009, 12:26
Re: need help with timer.. lol - by Serbish - 04.01.2009, 12:29
Re: need help with timer.. lol - by max007 - 04.01.2009, 12:34
Re: need help with timer.. lol - by Serbish - 04.01.2009, 12:41
Re: need help with timer.. lol - by rk01-the-one - 10.02.2009, 15:21

Forum Jump:


Users browsing this thread: 1 Guest(s)