24.10.2010, 19:23
Create a Var for Get Gate Open or Close,
VarGates = 0; // 0 Close - 1 Open
In OnPlayerUpdate:
if(IsPlayerInRangeOfPoint(playerid, 10.0, X, -Y, Z))
{
if(VarGates == 0)
{
GatesOpen
}
if(VarGates == 1)
{
GatesClose
}
}
public GatesOpen()
{
MoveObject // Gate1 Open
MoveObject // Gate2 Open
return 1;
}
public GatesClose()
{
MoveObject // Gate1 Close
MoveObject // Gate2 Close
return 1;
}
Use the Timer for destroy Flood on MoveObject
VarGates = 0; // 0 Close - 1 Open
In OnPlayerUpdate:
if(IsPlayerInRangeOfPoint(playerid, 10.0, X, -Y, Z))
{
if(VarGates == 0)
{
GatesOpen
}
if(VarGates == 1)
{
GatesClose
}
}
public GatesOpen()
{
MoveObject // Gate1 Open
MoveObject // Gate2 Open
return 1;
}
public GatesClose()
{
MoveObject // Gate1 Close
MoveObject // Gate2 Close
return 1;
}
Use the Timer for destroy Flood on MoveObject