how to do opening of gate from 2 points.
#1

there are 2 points with coordinates which a gate must be opened from:
1 point) -2127.4292, -80.0525, 35.3081
2 point) -2140.1570, -75.0254, 38.0045


it opening from a 1 point
------------------------------------
if(IsPlayerInSphere(i, -2127.4292, -80.0525, 35.3081,)
{
if (Gates12[i] == 1)
{
MoveDynamicObject(Gatesid1, -2136.3835, -80.5887, 35.3203,4);
MoveDynamicObject(Gatesid2, -2118.3835, -80.5887, 35.3203,4);
Gates12[i] = 0;
}
else
{
MoveDynamicObject(Gatesid1, -2131.3835, -80.5887, 35.3203,1);
MoveDynamicObject(Gatesid2, -2123.3835, -80.5887, 35.3203,1);
}
}
else
{
Gates12[i] = 1;
}
================================================
but as to do that was a gate opened and from 1 and from 2 points?
Reply
#2

pawn Код:
if(IsPlayerInRangeOfPoint(i, 8.0, -2127.4292, -80.0525, 35.3081,) || IsPlayerInRangeOfPoint(i, 8.0, -2140.1570, -75.0254, 38.0045))
     {
     if (Gates12 == 1)
      {
      MoveDynamicObject(Gatesid1, -2136.3835, -80.5887, 35.3203,4);  
      MoveDynamicObject(Gatesid2, -2118.3835, -80.5887, 35.3203,4);
      Gates12 = 0;
      }
     else
       {
       MoveDynamicObject(Gatesid1, -2131.3835, -80.5887, 35.3203,1);
       MoveDynamicObject(Gatesid2, -2123.3835, -80.5887, 35.3203,1);
       }
     }
   else
     {
     Gates12 = 1;
     }
Reply
#3

pawn Код:
if(PlayerToPoint(15, i, -2127.4292, -80.0525, 35.3081) || PlayerToPoint(15, i, -2140.1570, -75.0254, 38.0045))
    {
        if (Gates12 == 1)
        {
            MoveDynamicObject(Gatesid1, -2136.3835, -80.5887, 35.3203,4);
        MoveDynamicObject(Gatesid2, -2118.3835, -80.5887, 35.3203,4);
        Gates12 = 0;
        }
        else
        {
            MoveDynamicObject(Gatesid1, -2131.3835, -80.5887, 35.3203,1);
        MoveDynamicObject(Gatesid2, -2123.3835, -80.5887, 35.3203,1);
        }
    }
    else
    {
        Gates12 = 1;
    }
Reply
#4

PlayerToPoint is old and slow.
Reply
#5

Quote:
Originally Posted by Daren_Jacobson
PlayerToPoint is old and slow.
True
Reply
#6

You're also moving your gates inappropriately. The method you're doing will only allow the gate to work for the last connected player. (assuming IsPlayerConnected is being used, if not, the only player id 500 can open it)
Reply
#7

no, required only Isplayerinsphere.

is it whew possible?
---------------------

if(IsPlayerInSphere(i, 8.0, -2127.4292, -80.0525, 35.3081,) || IsPlayerInSphere(i, 8.0, -2140.1570, -75.0254, 38.0045))
{
if (Gates12 == 1)
{
MoveDynamicObject(Gatesid1, -2136.3835, -80.5887, 35.3203,4);
MoveDynamicObject(Gatesid2, -2118.3835, -80.5887, 35.3203,4);
Gates12 = 0;
}
else
{
MoveDynamicObject(Gatesid1, -2131.3835, -80.5887, 35.3203,1);
MoveDynamicObject(Gatesid2, -2123.3835, -80.5887, 35.3203,1);
}
}
else
{
Gates12 = 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)