[SOLVED] CountDown..
#1

I've a drift script, that i made witch you can invite somebody to a drift.. after he confirm that
you teleport with him to some place and there is a count down

new Count = 6;

Код:
forward CountDown();
public CountDown()
{
	new String[256];
	for (new i = 0; i < MAX_PLAYERS; i++)
	{
		if (Drift[i] == 1)
		{
       format(String, 256,"~r~~h~%d",Count);
       GameTextForPlayer(i,String,1000,6);
       if (Count > 0)
       {
			   Count --;
			   CountDown();
	     }
       else
       {
         format(String, 256,"~g~~h~GO");
         GameTextForPlayer(i,String,1000,6);
       }
    }
  }
	UnFreeze();
	Count = 6;
}

forward UnFreeze();
public UnFreeze()
{
	for (new i = 0; i < MAX_PLAYERS; i++)
  {
		if (Drift[i] == 1)
    {
      TogglePlayerControllable(i, 1);
    }
	}
	Count = 6;
}
why the count down won't work?
Reply
#2

Try return 1; after Count --;
CountDown();
Reply
#3

Код:
forward CountDown();
public CountDown()
{
	new String[64];
	for(new i = 0; i < GetMaxPlayers(); i++) if(IsPlayerConnected(i))
	{
		if(Drift[i] == 1)
		{
			format(String, 64,"~r~~h~%d",Count);
			GameTextForPlayer(i,String,1000,6);
		}
	}
	Count--;
	if(Count > 0)
	{
		SetTimer("CountDown",1000,false);
	}
	else
	{
		format(String, 64,"~g~~h~GO");
		for(new i = 0; i < GetMaxPlayers(); i++)
		{
			if(Drift[i] == 1)
			{
				TogglePlayerControllable(i, 1);
				GameTextForPlayer(i,String,1000,6);
			}
		}
		Count = 6;
	}
}
Reply
#4

Well, it wasn't niether of this comments but i found the bug..
=]
SOLVED.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)