01.10.2012, 15:00
I did have the whole script up, but i edited it and deleted it cause i fixed some other errors i originally had posted
pawn Код:
//automatic
//Change the coordinate by yourself
#define FILTERSCRIPT
#include <a_samp>
#include <foreach>//Download this include if you don't have one
#define MAX_GATES 1
new Gate[MAX_GATES],
bool:Open[MAX_GATES];
new GateTimer[MAX_GATES];
forward GateMovement1();
forward GateMovement2();
forward GateMovement3();
public OnFilterScriptInit()
{
Gate[0] = CreateObject(980, -2126.5476, -80.8152, 37.1033, -2116.7076, -80.8152, 37.1033, 250.0);
GateTimer[0] = SetTimer("GateMovement1",5000,1)
;
return 1;
}
public GateMovement1()
{
switch(Open{0})
{
case true:
{
foreach(Player,i)
{
if(IsPlayerInRangeOfPoint(i,10,-2116.7076, -80.8152, 37.1033)) return 1;
}
MoveObject(Gate[0],-2126.5476, -80.8152, 37.1033,1000);
Open{0} == false;
}
case false:
{
foreach(Player,i)
{
if(IsPlayerInRangeOfPoint(i,10,-2116.7076, -80.8152, 37.1033))
{
MoveObject(Gate[0],-2126.5476, -80.8152, 37.1033,1000);
Open{0} == true;
return 1;
}
}
}
}
return 1;
}