[HELP]Area Takeover Almost Done
#1

Hi, im making an area taking over system, took some from cod5 gm, but like.

I've put a timer on the gamemode init
SetTimer("AreaCheck", 1000, 1);

http://pastebin.com/7y0nwGXT

And when i go to the gangzone, it keeps going and going over the timer. Like

"You're dominating the area, wait 30 sec"
1 second later
"You're dominating the area, wait 30 sec"

Why is that happening?
Reply
#2

Код:
public AreaCheck()
{
  for(new i, m = GetMaxPlayers(); i < m; i++ )
  {
    if(IsPlayerInArea(i, -2158.000000, 1918.755737, -2133.312011, 1926.421630))
    {
      if(EnteredArea[i] == 0)
      {
	  	  if(Class[i] == TEAM_ARMY && CapturedBy == TEAM_ARMY || Class[i] == TEAM_MILITIA && CapturedBy == TEAM_MILITIA)
	      {
	        SendClientMessage(i, RED, "Esta бrea jб й do seu time!");
	        EnteredArea[i] = 1;
			  }
			  else
			  {
         if(Class[i] == TEAM_ARMY)
         {
           if(Capturing[i] == 0)
           {
             GangZoneFlashForAll(area, BLUE);
             SendClientMessageToAll(GREEN, "A бrea estб sendo capturada!");
		         EnteredArea[i] = 1; // He has entered
				     SendClientMessage(i,GREEN, "Fique aqui por trinta segundos para capturar a бrea!");
				     IfCapture[i] = 1;
             Capturing[i] = 1;
             takeOverTimer[i] = SetTimer("TakeOver", 30000, 0);
           }
         }
         else if(Class[i] == TEAM_ARMY)
         {
           if(Capturing[i] == 0)
           {
             GangZoneFlashForAll(area, BLUE);
             SendClientMessageToAll(GREEN, "A бrea estб sendo capturada!");
		         EnteredArea[i] = 1; // He has entered
				     SendClientMessage(i,GREEN, "Fique aqui por trinta segundos para capturar a бrea!");
				     IfCapture[i] = 1;
             Capturing[i] = 1;
             takeOverTimer[i] = SetTimer("TakeOver", 30000, 0);
           }
         }
			  }
		  }
  	  else
	    {
	      EnteredArea[i] = 0; // When he leaves, he's no longer in the area
		    KillTimer(takeOverTimer[i]);
        Capturing[i] = 0;

      }
    }
  }
  return 1;
}
just making things easier
Reply
#3

someone?
Reply
#4

Dude please, 12 hour bumps only.


Thanks
Reply
#5

what?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)