Automatic gate
#1

i have this but gate 2 not works.how to fix it?
PHP код:
forward areagatecheck();
public 
areagatecheck()
{
      for(new 
iMAX_PLAYERSi++)
      {
        if(
IsPlayerInRangeOfPoint(i15134.70611941.581421.6600))
        {
            if(
gTeam[i] != TEAM_Internationalforces) return;
              if(
areagate1o == false
              {
                    
MoveObject(areagate1121.60211941.584521.66005);
                
areagate1o true;
              }
              return;
        }
        else if(
IsPlayerInRangeOfPoint(i15205.49221730.351617.8281))
        {
            if(
gTeam[i] != TEAM_Internationalforces) return;
              if(
areagate2o == false)
              {
                    
MoveObject(areagate2286.06971833.772019.96115);
                
areagate2o true;
              }
              return;
        }
        return;
      }
      if(
areagate1o == true)
      {
        
MoveObject(areagate1134.70611941.581421.66005);
        
areagate1o false;
        return;
      }
      if(
areagate2o == true)
      {
        
MoveObject(areagate2205.49221730.351617.82815);
        
areagate2o false;
        return;
      }
      return;

Reply
#2

try this

PHP код:
forward areagatecheck();
public 
areagatecheck()
{
      for(new 
iMAX_PLAYERSi++)
      {
        if(
IsPlayerInRangeOfPoint(i15134.70611941.581421.6600))
        {
            if(
gTeam[i] == TEAM_Internationalforces)
            {
                  if(
areagate1o == false)
                   {
                    
MoveObject(areagate1121.60211941.584521.66005);
                    
areagate1o true;
                   }
            }
        }
        if(
IsPlayerInRangeOfPoint(i15205.49221730.351617.8281))
        {
            if(
gTeam[i] == TEAM_Internationalforces)
            {
                  if(
areagate2o == false)
                  {
                    
MoveObject(areagate2286.06971833.772019.96115);
                    
areagate2o true;
                  }
            }
        }
        if(!
IsPlayerInRangeOfPoint(i15134.70611941.581421.6600))
        {
                if(
areagate1o == true)
                {
                    
MoveObject(areagate1134.70611941.581421.66005);
                    
areagate1o false;
                }
        }
        if(!
IsPlayerInRangeOfPoint(i15205.49221730.351617.8281))
        {
                  if(
areagate2o == false)
                  {
                    
MoveObject(areagate2286.06971833.772019.96115);
                    
areagate2o true;
                  }
        }

Reply
#3

not works and you forget return;
The second is my problem.
Reply
#4

are you sure you have correct moving points of gates?
use it via any command see if it works then i will make some changes in that code.
Reply
#5

open:
286.0697, 1833.7720, 19.9611
close:
286.05475, 1819.83301, 19.96110
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)