need help with timer.. lol
#3

Quote:
Originally Posted by -=[Serbish
=- ]
I made a nice simple system for you ( took 2 mins of my life jk ).

Код:
new counter=10;

forward CountDown(playerid);

public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/countdown", cmdtext, true) == 0)
	{
		if(IsPlayerAdmin(playerid))
		{
			SetTimer("CountDown",1000,1);
			return 1;
		}
	}
	return 0;
}

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)
	{
		Kick(playerid);
	}
}
Just change the
Код:
Kick(playerid);
to your restart server function.
Nice.. but i need it automaticly restarts... so at 3:00:00 (at night!) it starts counting from 10 to 1 and restarts...
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)