01.11.2009, 00:33
There's a problem with your code though. If one player is close to it, the gate opens, but since other players are away from the gate, it will close. This means the gate will only open if every player is within range of the gate.
This method will fix that.
EDIT* I'm almost certain I've answered this before.
This method will fix that.
pawn Код:
public GroveGates()
{
new opengate;
for(new i; i< GetMaxPlayers();i++)
{
if(!IsPlayerConnected(i)) continue;
if((DMZone[i] == 4)&&IsPlayerInRangeOfPoint(i, 10.0, 2435.674561, -1656.416626, 13.420712))opengate=1;
}
if(opengate)MoveObject(ggate, 2435.637695, -1651.433228, 13.333119, 3.0);
else MoveObject(ggate, 2435.674561, -1656.416626, 13.420712, 3.0);
}