20.07.2012, 18:21
i have a problem i use for(new i=0,i<MAX_PLAYERS,i++) to open gates automatic but just the one with the highest ID can open gates any help?
public AutoTor()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i))continue;
if(IsPlayerInRangeOfPoint( i, 15,345.27, 1797.73, 19.45))
{
MoveObject(ArmyGate3l,339.28, 1793.84, 18.31, 3, 0.00, 0.00, 33.02);
MoveObject(ArmyGate3r,351.15, 1801.99, 18.31, 3, 0.00, 0.00, 35.95);
}
else
{
MoveObject(ArmyGate3l,342.90, 1796.20, 18.31, 3, 0.00, 0.00, 33.02);
MoveObject(ArmyGate3r,347.55, 1799.39, 18.31, 3, 0.00, 0.00, 35.95);
}
if(IsPlayerInRangeOfPoint( i, 15, 286.03, 1820.46, 19.94))
{
MoveObject(ArmyGate1,286.03, 1833.72, 19.94, 3, 0.00, 0.00, 90.00);
}
else
{
MoveObject(ArmyGate1,286.03, 1820.46, 19.94, 3, 0.00, 0.00, 90.00);
}
if(IsPlayerInRangeOfPoint( i, 15, 134.92, 1941.57, 21.64))
{
MoveObject(ArmyGate2, 120.84, 1941.57, 21.62, 3, 0.00, 0.00, 0.00);
}
else
{
MoveObject(ArmyGate2,134.92, 1941.57, 21.64, 3, 0.00, 0.00, 0.00);
}
}
return 1;
}