03.02.2010, 23:23
Check this out..
pawn Код:
//modify you timer to SetTimer("CheckGate",..
forward CheckGate();
public CheckGate()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(!IsPlayerConnected(i)) continue;
if(IsPlayerInRangeOfPoint(i, 10.0, 1589.048096, -1637.884277, 12.902792))
{
if(c_gate_status == 0)
{
if(GetPlayerTeam(i) == 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(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;
}
}
}