03.01.2012, 10:40
This is my current gate check:
The problem is, it only opens for id 0.. Anyone knows why?
Thanks.. Kevin
pawn Код:
forward GateCheck1();
public GateCheck1()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (APlayerData[i][PlayerClass] == ClassSRT)
{
if(IsPlayerInRangeOfPoint(i, 20.0, 2294.00000000,2497.19995117,4.00000000))
{
MoveObject(AutomaticGate1, 2294.00000000,2497.19995117,0.50000000, 3.0);
}
else
{
MoveObject(AutomaticGate1, 2294.00000000,2497.19995117,4.00000000, 3.0);
}
}
else
return 0;
}
}
return 1;
}
forward GateCheck2();
public GateCheck2()
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if (APlayerData[i][PlayerClass] == ClassSRT)
{
if(IsPlayerInRangeOfPoint(i, 20.0, 2335.00000000,2443.69995117,6.50000000))
{
MoveObject(AutomaticGate2, 2335.00000000,2443.69995117,3.00000000, 3.0);
}
else
{
MoveObject(AutomaticGate2, 2335.00000000,2443.69995117,6.50000000, 3.0);
}
}
else
return 0;
}
}
return 1;
}
Thanks.. Kevin