15.11.2011, 10:28
Try:
pawn Код:
#include <a_samp>
new gate;
new bool:gateopen;
public OnFilterScriptInit()
{
SetTimer("GateCheck", 800, true);
gate = CreateObject(969,1549.59997559,-1623.00000000,12.60000038,0.0, 0.0, 96.0, 250.0);
return 1;
}
forward GateCheck();
public GateCheck()
{
for(new i; i < MAX_PLAYERS; i++)
{
if(IsPlayerInRangeOfPoint(i, 15.0, 1549.59997559, -1623.00000000, 12.6000003))
{
if(gateopen == false)
{
MoveObject(gate, 1549.59997559, -1623.00000000, 9.60000038, 3.5);
gateopen = true;
return 1;
}
if(gateopen == true)
{
MoveObject(gate, 1549.59997559, -1623.00000000, 12.60000038, 3.5);
gateopen = false;
return 1;
}
}
}
return 1;
}