22.11.2009, 11:44
As the tittle says I made 3 automatic gates, Two at the LSPD, One for the garage and one for the entrance and one for the LSFD abit behind the LSPD.
Alright my problem is when I only had one gate it would close by it self but now that I have three they doesn't close anymore.
E.G I go near the first LSPD gate, it opens but doesn't close, now I go infront of the LSPD garage it opens and the first LSPD gate closes but the garage doesn't close.
Can someone help me, please.
I have no errors, all the codes are at the right places
Thanks~
Alright my problem is when I only had one gate it would close by it self but now that I have three they doesn't close anymore.
E.G I go near the first LSPD gate, it opens but doesn't close, now I go infront of the LSPD garage it opens and the first LSPD gate closes but the garage doesn't close.
Can someone help me, please.
pawn Код:
forward LspdGate();
forward LspdGarage();
forward LsfdGate();
pawn Код:
SetTimer("LsfdGate", 300, true);
SetTimer("LspdGate", 300, true);
SetTimer("LspdGarage", 300, true);
pawn Код:
public LsfdGate()
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i, 20.0, 1760.2771,-1696.0669,13.4326) && OpenGate[i] == 0)
{
MoveObject(lsfd_gate1, 1761.606445, -1691.706055, 6.469672, 1.5);
MoveObject(lsfd_gate2, 1761.379028, -1700.606934, 6.472194, 1.5);
OpenGate[i] = 1;
}
else if(!IsPlayerInRangeOfPoint(i, 20.0, 1760.2771,-1696.0669,13.4326) && OpenGate[i] == 1)
{
MoveObject(lsfd_gate1, 1761.606445, -1691.706055, 12.744606, 1.5);
MoveObject(lsfd_gate2, 1761.379028, -1700.606934, 12.722128, 1.5);
OpenGate[i] = 0;
}
}
}
public LspdGate()
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i, 15.0, 1545.6561, -1627.6211, 13.3828) && OpenGate[i] == 0)
{
MoveObject(lspd_gate2, 1545.754639, -1614.595459, 14.093480, 1.5);
MoveObject(lspd_gate1, 1545.765381, -1638.832275, 14.093480, 1.5);
OpenGate[i] = 1;
}
else if(!IsPlayerInRangeOfPoint(i, 15.0, 1545.6561, -1627.6211, 13.3828) && OpenGate[i] == 1)
{
MoveObject(lspd_gate1, 1545.765381, -1631.450073, 14.093480, 1.5);
MoveObject(lspd_gate2, 1545.729614, -1623.504150, 14.093480, 1.5);
OpenGate[i] = 0;
}
}
}
public LspdGarage()
{
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i, 10.0, 1588.489014, -1637.890991, 13.268718) && OpenGate[i] == 0)
{
MoveObject(lspd_garage, 1597.340332, -1637.890991, 13.268718, 1.5);
OpenGate[i] = 1;
}
else if(!IsPlayerInRangeOfPoint(i, 10.0, 1588.489014, -1637.890991, 13.268718) && OpenGate[i] == 1)
{
MoveObject(lspd_garage, 1588.489014, -1637.890991, 13.268718, 1.5);
OpenGate[i] = 0;
}
}
}
Thanks~