Gates aren't moving.
#10

Ok, i need script that will open and close gates for all players!

I do this: + playerplaysound

pawn Код:
forward CheckGate();
public CheckGate()
{
  for(new i=0; i<GetMaxPlayers(); i++)
  {
    if(!IsPlayerConnected(i)) continue;
    if(IsPlayerInRangeOfPoint(i, 12.0, 213.8831,1875.3693,13.1470) && OpenGate0 == 0)
    {
      MoveObject(a51_desna,207.838668,1875.358276,13.885452,1.0);
      MoveObject(a51_leva,219.970260,1875.358276,13.885452,1.0);
      PlayerPlaySound(i, 1165, 213.8831, 1875.3693, 13.1470);
      OpenGate0 = 1; //i cant do without this, because i cant use than sound for close  downstairs
    }
    else if(!IsPlayerInRangeOfPoint(i, 12.0, 213.8831,1875.3693,13.1470) && OpenGate0 == 1)
    {
      MoveObject(a51_desna,211.854766,1875.358276,13.885452,1.0);
      MoveObject(a51_leva,215.952407,1875.358276,13.885452,1.0);
      PlayerPlaySound(i, 1165, 213.8831, 1875.3693, 13.1470);
      OpenGate0 = 0;
    }
  }
}


public OnObjectMoved(objectid)
{
  new Float:x, Float:y, Float:z;
  GetObjectPos(objectid, x, y, z);
  for(new i=0; i<GetMaxPlayers(); i++)
  {
    if(objectid == a51_desna && x==207.838668 && y==1875.358276 && z==13.885452 && OpenGate0 == 1)
    {
        PlayerPlaySound(playerid, 1166, 213.8831, 1875.3693, 13.1470); //stop sound
    }
    if(objectid == a51_desna && x==211.854766 && y==1875.358276 && z==13.885452 && OpenGate0 == 0)
    {
        PlayerPlaySound(playerid, 1166, 213.8831, 1875.3693, 13.1470); //stop sound
    }
  }
}
I do this. Itworks all included sounds. Sounds are the same like in original gates (transfender)... And i asking... Will that object movements be seen for all players And how can i do, that this sound will be heared for all players, not only for player who enter in the range of point??

thank you
Reply


Messages In This Thread
Gates aren't moving. - by [mad]MLK - 31.10.2009, 19:38
Re: Gates aren't moving. - by member - 31.10.2009, 20:20
Re: Gates aren't moving. - by ev0lution - 31.10.2009, 21:11
Re: Gates aren't moving. - by [mad]MLK - 31.10.2009, 21:25
Re: Gates aren't moving. - by Joe Staff - 01.11.2009, 00:33
Re: Gates aren't moving. - by yugokoral - 01.11.2009, 08:23
Re: Gates aren't moving. - by Joe Staff - 01.11.2009, 19:48
Re: Gates aren't moving. - by yugokoral - 01.11.2009, 20:12
Re: Gates aren't moving. - by Synkro93 - 01.11.2009, 20:18
Re: Gates aren't moving. - by yugokoral - 01.11.2009, 20:48

Forum Jump:


Users browsing this thread: 1 Guest(s)