Gate Problem
#1

Hi, I don't know why gate3 isn't moving. But gate and gate2 is working fine. Idk why gate3 isn't working. ANyone help. Thanks!

PHP код:

new gate;
new 
gate2;
new 
gate3;
new 
bool:gateopen;
SetTimer("GateCheck"800true); //This is used to create the timer. The "GateCheck" is the callback we'll be using,
    
gate CreateObject(971, -1635.6461,688.7094,7.1875,   0.000.0000.00);
    
gate2 CreateObject(971, -1626.8461,688.7094,7.1875,   0.000.0000.00);
    
gate3 CreateObject(971, -2593.5501,1354.8292,7.0391,   -1.00, -1.0048.00);
    
CreateObject(19870, -1621.8461,688.7094,7.1875,   0.000.0000.00);
public 
GateCheck()
{
  for(new 
iMAX_PLAYERSi++) // Start the loop
  
{
    if(!
IsPlayerConnected(i)) continue;
    if(
gTeam[i] == COPS || gTeam[i] == ARMY || gTeam[i] == FBI || gTeam[i] == CIA)
    {
      if(
IsPlayerInRangeOfPoint(i10.0, -1630.6461,688.7094,7.1875)) //Check if any player is in the area. Replace '8.0, 3.0, 10.0' with your own coordinates of your closed gate.
      
{
        if(
gateopen == false// If the gate isn't open...
        
{
           
MoveObject(gate, -1635.6461,688.7094,-2.18752.5); //Then open it! Change '32.0, 12.0, 10.0' to the coordinates of your opened gate.
           
MoveObject(gate2, -1626.8461,688.7094,-2.18752.5);
           
MoveObject(gate3, -2493.5501,1354.8292,-7.03912.5, -1.00, -1.0048.00);
           
gateopen true// Setting this to true indicates it's open(ing)
        
}
        return; 
//This closes the callback
      
}
    }
  }
  
//This is called if nobody has been found near the gate. Obviously, because 'return' would fully close the function and this wouldn't be used then.
  
if(gateopen == true//If the gate IS open, but there's no one near..
  
{
    
MoveObject(gate, -1635.6461,688.7094,7.18752.5); // Change the '8.0, 3.0, 10.0' to the coordinates of your gate when it's closed.
    
MoveObject(gate2, -1626.8461,688.7094,7.18752.5);
    
MoveObject(gate3, -2593.5501,1354.8292,7.03912.5, -1.00, -1.0048.00);
    
gateopen false//This indicates the gate is closed again. Or at least, closing.
  
}

Reply


Messages In This Thread
Gate Problem - by STONEGOLD - 20.06.2015, 10:47
Re: Gate Problem - by baba1234 - 20.06.2015, 10:52
Re: Gate Problem - by Neos07 - 20.06.2015, 10:53
Re: Gate Problem - by Hessu - 20.06.2015, 10:56
Re: Gate Problem - by Darrenr - 20.06.2015, 11:08
Re: Gate Problem - by STONEGOLD - 20.06.2015, 11:34
Re: Gate Problem - by Darrenr - 20.06.2015, 20:26

Forum Jump:


Users browsing this thread: 2 Guest(s)