03.02.2010, 23:01
Try this:
Tho wouldn't it just be CheckGate() and GetPlayerTeam(i)
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
{
MoveObject(c_gate, 1589.048096, -1637.884277, 12.902792, 2);
PlayerPlaySound(i, 1165, 1589.048096, -1637.884277, 12.902792);
c_gate_status = 0;
}
}
}