2 Questions: Gate/Garage/Door Faction help
#2

Well, that`s not that hard, talking about question 2 ... all you have to do is add if( IsPlayerInRangeOfPoint( playerid, distance, x, y, z ) )

Let me make one for you:

pawn Код:
//PDGate1
    if(strcmp(cmdtext, "/OpenPDGate1", true) == 0)
    {
         if( IsPlayerInRangeOfPoint( playerid, 5.0, 253.220,105.377,1004.370 ) )
         {
                 MoveObject(PDGate1,253.220703125,105.3779296875,1004.3708496094, 1);
                 SendClientMessage(playerid, COLOR_YELLOW, "Restricted Area!");
                 return 1;
         }
         return 1;
    }

    if(strcmp(cmdtext, "/ClosePDGate1", true) == 0)
        {
             if( IsPlayerInRangeOfPoint( playerid, 5.0, 253.220,105.377,1004.370 ) )
             {
                    MoveObject(PDGate1,253.2209,105.3784,1002.2187, 1 );
                    SendClientMessage(playerid, COLOR_YELLOW, "Restricted Area!");
                    return 1;
             }
        return 1;
        }
So, overall, if you want to modify the distance, just modify the 5.0.

And to add new coords just add like:

pawn Код:
if(strcmp(cmdtext, "/OpenPDGate1", true) == 0)
    {
         if( IsPlayerInRangeOfPoint( playerid, 5.0, 253.220,105.377,1004.370 ) )
         {
                 MoveObject(PDGate1,253.220703125,105.3779296875,1004.3708496094, 1);
                 SendClientMessage(playerid, COLOR_YELLOW, "Restricted Area!");
                 return 1;
         }
         if ( IsPlayerInRangeOfPoint( playerid,distance, x, y, z ) )
         {
          //and what happens here
         }
           return 1;
    }
Hope I helped.
Reply


Messages In This Thread
2 Questions, Please Help - by BurgessGaming - 08.03.2011, 13:24
Re: 2 Questions, Please Help - by antonio112 - 08.03.2011, 17:13
Re: 2 Questions: Gate/Garage/Door Faction help - by BurgessGaming - 09.03.2011, 00:13

Forum Jump:


Users browsing this thread: 1 Guest(s)