PHP код:
new ELEVATE[4];
new bool:gate_status[4 char];
forward Elevate();
forward Elevate1();
forward Elevate2();
forward Elevate3();
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" ..::Sky Elevator by iNinja::..");
print("--------------------------------------\n");
ELEVATE[0] = CreateObject(18755, -897.09472, 357.890258, 1067.30468, 0.000000, 0.500000, -180.000000);
ELEVATE[1] = CreateObject(18755, -892.85931, 1103.51538, 1067.47033, 0.000000, -3.500000, 90.500000);
ELEVATE[2] = CreateObject(18755, -147.20968, 1099.57031, 1067.64135, 0.000000, 0.000000, 0.000000);
ELEVATE[3] = CreateObject(18755, -151.16056, 354.454223, 1067.18774, 0.000000, 0.000000, -91.000000);
SetTimer("Elevate",1000,true);
return 1;
}
public Elevate()
{
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i,2.0,150.9113, 355.6207, 1066.3877))gate_status{0}=true;
else if(IsPlayerInRangeOfPoint(i,6.0,1590.30, -1637.98, 14.69))gate_status{1}=true;
else if(IsPlayerInRangeOfPoint(i,5.0,1543.35, -1627.73, 14.67))gate_status{2}=true;
else if(IsPlayerInRangeOfPoint(i,2.0,1543.32, -1620.90, 13.63))gate_status{3}=true;
}
if(gate_status{1}){
MoveObject(ELEVATE[0], 413.7591,2536.1660,19.1484, 2.0);
gate_status{1}=false;
}
else if(gate_status{1} == false)MoveObject(ELEVATE[0], -897.09472, 357.890258, 1067.30468, 2.0);
if(gate_status{2}){
MoveObject(ELEVATE[1], 1598.02, -1637.98, 14.69, 2.0);
gate_status{1}=false;
}
else if(gate_status{2} == false)MoveObject(ELEVATE[1], 1590.30, -1637.98, 14.69, 2.0);
if(gate_status{2}){
MoveObject(ELEVATE[2], 1543.35, -1627.73, 9.59, 2.0);
gate_status{2} = false;
}
else if(gate_status{2} == false)MoveObject(ELEVATE[2], 1543.35, -1627.73, 14.67, 2.0);
if(gate_status{3}){
MoveObject(ELEVATE[3], 1543.32, -1622.44, 13.63, 2.0);
gate_status{3}=false;
}
else if(gate_status{3} == false)MoveObject(ELEVATE[3], 1543.32, -1620.90, 13.63, 2.0);
}
first its's better to use only one timer for something like that and char arrays are very good for bool values