05.11.2010, 14:52
I created this automatic gate, but it only closes, it dont open, when the GM is loaded, it sets the gate to the open position and when i go near the gate, it closes, but when i walk back, it dont open.
pawn Код:
public Gate()
{
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,5.0,-505.5048828125, 2593.0556640625, 55.983978271484))State = 1;
}
if(State)MoveObject(hgate, -505.5048828125, 2593.0556640625, 55.983978271484,3.0);
else MoveObject(hgate, -505.65878295898, 2601.5754394531, 55.89282989502,5.0);
}