Creating a gate
#4

Add this on top of your script
Код:
new impaund_Open; // it checks if gates is open
then on your "OnPlayerCommandText"
Код:
if (strcmp("/open", cmdtext, true, 10) == 0)
{
      if(impaund_Open == 1) return SendClientMessage(playerid ,SOME COLOR ,"Gate is already open!");
      if(IsPlayerInRangeOfPoint(playerid, 15.0, 1620.66, -1862.22, 15.33) )
      {
          // NEW = position of gates when they are open
          MoveObject(impaund, NEW X postion, NEW Y postion, NEW Z postion, 3.0);
          impaund_Open = 1;
       }
       else return SendClientMessage(playerid ,SOME COLOR ,"You are not near that gate!");
      return 1;
}

else if (strcmp("/close", cmdtext, true, 10) == 0)
{
      if(impaund_Open == 0) return SendClientMessage(playerid ,SOME COLOR ,"Gate is already closed!");
      if(IsPlayerInRangeOfPoint(playerid, 15.0, 1620.66, -1862.22, 15.33) )
      {
          MoveObject(impaund, 1620.66, -1862.22, 15.33, 3.0);
          impaund_Open = 0;
       }
       else return SendClientMessage(playerid ,SOME COLOR ,"You are not near that gate!");
      return 1;
}
Reply


Messages In This Thread
Creating a gate - by Stm - 03.09.2012, 18:32
Re: Creating a gate - by detter - 03.09.2012, 18:41
Re: Creating a gate - by Stm - 03.09.2012, 19:02
Re: Creating a gate - by detter - 03.09.2012, 19:16
Re: Creating a gate - by Stm - 03.09.2012, 19:24
Re: Creating a gate - by rBcollo - 03.09.2012, 19:25
Re: Creating a gate - by Stm - 03.09.2012, 19:56
Re: Creating a gate - by detter - 03.09.2012, 19:58
Re: Creating a gate - by Stm - 03.09.2012, 20:02

Forum Jump:


Users browsing this thread: 2 Guest(s)