forward LspdGate();
forward LspdGarage();
forward LsfdGate();
SetTimer("LsfdGate", 300, true);
SetTimer("LspdGate", 300, true);
SetTimer("LspdGarage", 300, true);
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;
}
}
}
SetTimer("LsfdGate", 5000, 0);
SetTimer("LspdGate", 5000, 0);
SetTimer("LspdGarage", 5000, 0);
Originally Posted by zєяσмαиѕтєя
Try this:
pawn Код:
|
public LspdGarage() { for(new i = 0; i < GetMaxPlayers(); i++) { if(!IsPlayerConnected(i)) continue; if(PlayerToPoint(8.0, i, 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(!PlayerToPoint(8.0, i, 1588.489014, -1637.890991, 13.268718) && OpenGate[i] == 1) { MoveObject(lspd_garage, 1588.489014, -1637.890991, 13.268718, 1.5); OpenGate[i] = 0; } } return 1; }
public LspdGate() { for(new i = 0; i < GetMaxPlayers(); i++) { if(!IsPlayerConnected(i)) continue; if(PlayerToPoint(10.0, i, 1545.765381, -1631.450073, 14.093480) && 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(!PlayerToPoint(10.0, i, 1545.765381, -1631.450073, 14.093480) && 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; } } return 1; }
public LsfdGate() { for(new i = 0; i < GetMaxPlayers(); i++) { if(!IsPlayerConnected(i)) continue; if(PlayerToPoint(10.0, i, 1761.606445, -1691.706055, 12.744606) && 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(!PlayerToPoint(10.0, i, 1761.606445, -1691.706055, 12.744606) && 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; } } return 1; }
SetTimer("LsfdGate", 300, true); SetTimer("LspdGate", 300, true); SetTimer("LspdGarage", 300, true);
Originally Posted by Seif_
Quote:
Use IsPlayerInRangeOfPoint instead of PlayerToPoint. |
SetTimer("LspdGarage", 5000, true);
new LspdGarageGate = 0; //closed
public LspdGarage()
{
new max = GetMaxPlayers();
for(new i = 0; i < max; i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i, 8.0, 1588.489014, -1637.890991, 13.268718) && OpenGate[i] == 0)
{
if(LspdGarageGate == 0)
{
MoveObject(lspd_garage, 1597.340332, -1637.890991, 13.268718, 1.5); //open
LspdGarageGate = 1;
}
else
{
MoveObject(lspd_garage, 1588.489014, -1637.890991, 13.268718, 1.5); //close
LspdGarageGate = 0;
}
}
}
}