[HELP] Problem with unfreezing
#4

If you're Gamemode is something where they have an option whether they want to be in the race or not, then I might have a solution, but I'm made new timers because I just retyped it real quick.. I'm sure you'll know what I've done, I tested it and it worked on my pc I'll just cut the bits that you need.


Код:
//forwards
OneSecondTimer();
OnRaceStart(playerid);

new count;
new InRace[MAX_PLAYERS];

//OnGameModeInit
SetTimer("OneSecondTimer", 1000, true);

//Where ever you set the players stats to "0" Most likely OnPlayerConnect
InRace[playerid] = 0;



public OnRaceStart(playerid)
{
	if(InRace[playerid] == 1)
	{
	  TogglePlayerControllable(playerid, false);
		count = 6;
	}
	return 1;
}

//I just made another one second timer because you didn't put SetTimer, so I assumed there is more //coding to this.
public OneSecondTimer()
{
  new string[64];
  for(new i; i<MAX_PLAYERS; i++)
  {
	  if(IsPlayerConnected(i))
	  {
	    if(InRace[i] == 1)
	    {
			if(count > 0)
			{
			  count -= 1;
			  format(string, 15, "~y~%d", count - 1);
    		  PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
			}
		 	if(count == 1)
 		 	{
    		  TogglePlayerControllable(i, true);
	  	      format(string, 15, "~g~GO GO GO");
	 	      PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
			}
			GameTextForPlayer(i, string, 1000, 3);
		 }
	  }
   }
   return 1;
}
Reply


Messages In This Thread
[HELP] Problem with unfreezing - by arnutisz - 30.08.2009, 20:20
Re: [HELP] Problem with unfreezing - by Chaprnks - 30.08.2009, 20:24
Re: [HELP] Problem with unfreezing - by arnutisz - 30.08.2009, 20:33
Re: [HELP] Problem with unfreezing - by JR ! - 30.08.2009, 21:50

Forum Jump:


Users browsing this thread: 3 Guest(s)