03.02.2010, 22:32
I walk up to my gate, It opens, If i walk away, It stays open?
It should close? But why, I checked my coordinates..
It should close? But why, I checked my coordinates..
pawn Код:
public CheckGate(playerid)
{
for(new i;i<MAX_PLAYERS;i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i, 10.0, 1589.048096, -1637.884277, 12.902792) && c_gate_status == 0)
{
if(GetPlayerTeam(playerid) == 1)
{
MoveObject(c_gate, 1596.955811, -1637.884277, 12.902792, 2);
PlayerPlaySound(i, 1165, 1589.048096, -1637.884277, 12.902792);
c_gate_status = 1;
}
else if(!IsPlayerInRangeOfPoint(i, 10.0, 1589.048096, -1637.884277, 12.902792) && c_gate_status == 1)
{
MoveObject(c_gate, 1589.048096, -1637.884277, 12.902792, 2);
PlayerPlaySound(i, 1165, 1589.048096, -1637.884277, 12.902792);
c_gate_status = 0;
}
}
}
}