The closest checkpoint
#1

Hello, excuse my bad english, how can I find out which is the nearest checkpoint me? I mean me choose a checkpoint server closest to me. Here's what I tried:
Код:
  new Float: Distanta[24];
      Distanta[1] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),2216.9360,-2230.9141,13.5469);
      Distanta[2] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),2824.2129,914.8077,11.7811);
      Distanta[3] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),1610.0208,2311.9502,11.8367);
      Distanta[4] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),1109.9924,1863.9613,11.8549);
      Distanta[5] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),1600.5649,1618.1482,11.8332);
      Distanta[6] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),1694.2490,718.6793,11.8321);
      Distanta[7] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),-1816.4451,-113.3130,6.5047);
      Distanta[8] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),-2755.5593,-291.0544,8.0513);
      Distanta[9] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),-1730.5198,125.4838,4.5593);
      Distanta[10] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),-1980.8016,454.6620,36.1843);
      Distanta[11] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),-2131.7454,-137.3003,36.3296);
      Distanta[12] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),-2752.8311,789.5768,54.5924);
      Distanta[13] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),-2462.9443,725.9617,36.0254);
      Distanta[14] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),353.4518,-1369.4559,15.3268);
      Distanta[15] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),-279.6434,-2188.5930,29.7319);
      Distanta[16] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),-1932.7311,-1794.6277,32.6503);
      Distanta[17] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),-1997.9462,-2424.0452,31.6722);
      Distanta[18] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),-1574.5662,-2742.9358,49.5561);
      Distanta[19] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),2454.1226,-1419.8866,24.8431);
      Distanta[20] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),2760.9805,-2459.2578,14.5597);
      Distanta[21] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),810.8070,-602.3696,17.3526);
      Distanta[22] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),-209.4572,-278.9285,2.4487);
      Distanta[23] = GetVehicleDistanceFromPoint(GetPlayerVehicleID(playerid),-523.3458,2593.6199,54.4276);
	  
if(Distanta[1] < Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid, 2216.9360,-2230.9141,13.5469,7.0);
     }
     if(Distanta[2] < Distanta[1] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,2824.2129,914.8077,11.7811,7.0);
     }
     if(Distanta[3] < Distanta[1] && Distanta[2] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,1610.0208,2311.9502,11.8367,7.0);
     }
     if(Distanta[4] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,1109.9924,1863.9613,11.8549,7.0);
     }
     if(Distanta[5] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,1600.5649,1618.1482,11.8332,7.0);
     }
     if(Distanta[6] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,1694.2490,718.6793,11.8321,7.0);
     }
     if(Distanta[7] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,-1816.4451,-113.3130,6.5047,7.0);
     }
     if(Distanta[8] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,-2755.5593,-291.0544,8.0513,7.0);
     }
     if(Distanta[9] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,-1730.5198,125.4838,4.5593,7.0);
     }
     if(Distanta[10] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,-1980.8016,454.6620,36.1843,7.0);
     }
     if(Distanta[11] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,-2131.7454,-137.3003,36.3296,7.0);
     }
     if(Distanta[12] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,-2752.8311,789.5768,54.5924,7.0);
     }
     if(Distanta[13] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,-2462.9443,725.9617,36.0254,7.0);
     }
     if(Distanta[14] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,353.4518,-1369.4559,15.3268,7.0);
     }
     if(Distanta[15] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,-279.6434,-2188.5930,29.7319,7.0);
     }
     if(Distanta[16] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,-1932.7311,-1794.6277,32.6503,7.0);
     }
     if(Distanta[17] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,-1997.9462,-2424.0452,31.6722,7.0);
     }
     if(Distanta[18] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,-1574.5662,-2742.9358,49.5561,7.0);
     }
     if(Distanta[19] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[20] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,2454.1226,-1419.8866,24.8431,7.0);
     }
     if(Distanta[20] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[21] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,2760.9805,-2459.2578,14.5597,7.0);
     }
     if(Distanta[21] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[22] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,810.8070,-602.3696,17.3526,7.0);
     }
     if(Distanta[22] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[23])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,-209.4572,-278.9285,2.4487,7.0);
     }
     if(Distanta[23] < Distanta[1] && Distanta[2] && Distanta[3] && Distanta[4] && Distanta[5] && Distanta[6] && Distanta[7] && Distanta[8] && Distanta[9] && Distanta[10] && Distanta[11] && Distanta[12] && Distanta[13] && Distanta[14] && Distanta[15] && Distanta[16] && Distanta[17] && Distanta[18] && Distanta[19] && Distanta[20] && Distanta[21] && Distanta[22])
     {
      CP[playerid] = 770;
      SetPlayerCheckpoint(playerid,-523.3458,2593.6199,54.4276,7.0);
     }
and

Код:
if(IsPlayerInRangeOfPoint(playerid, 900000000.0,2216.9360,-2230.9141,13.5469))
      {
      SetPlayerCheckpoint(playerid, 2216.9360,-2230.9141,13.5469,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,2824.2129,914.8077,11.7811))
      {
      SetPlayerCheckpoint(playerid,2824.2129,914.8077,11.7811,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,1610.0208,2311.9502,11.8367))
      {
      SetPlayerCheckpoint(playerid,1610.0208,2311.9502,11.8367,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,1109.9924,1863.9613,11.8549))
      {
      SetPlayerCheckpoint(playerid,1109.9924,1863.9613,11.8549,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,1600.5649,1618.1482,11.8332))
      {
      SetPlayerCheckpoint(playerid,1600.5649,1618.1482,11.8332,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,1694.2490,718.6793,11.8321))
      {
      SetPlayerCheckpoint(playerid,1694.2490,718.6793,11.8321,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,-1816.4451,-113.3130,6.5047))
      {
      SetPlayerCheckpoint(playerid,-1816.4451,-113.3130,6.5047,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,-2755.5593,-291.0544,8.0513))
      {
      SetPlayerCheckpoint(playerid,-2755.5593,-291.0544,8.0513,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,-1730.5198,125.4838,4.5593))
      {
      SetPlayerCheckpoint(playerid,-1730.5198,125.4838,4.5593,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,-1980.8016,454.6620,36.1843))
      {
      SetPlayerCheckpoint(playerid,-1980.8016,454.6620,36.1843,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,-2131.7454,-137.3003,36.3296))
      {
      SetPlayerCheckpoint(playerid,-2131.7454,-137.3003,36.3296,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,-2752.8311,789.5768,54.5924))
      {
      SetPlayerCheckpoint(playerid,-2752.8311,789.5768,54.5924,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,-2462.9443,725.9617,36.0254))
      {
      SetPlayerCheckpoint(playerid,-2462.9443,725.9617,36.0254,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,353.4518,-1369.4559,15.3268))
      {
      SetPlayerCheckpoint(playerid,353.4518,-1369.4559,15.3268,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,-279.6434,-2188.5930,29.7319))
      {
      SetPlayerCheckpoint(playerid,-279.6434,-2188.5930,29.7319,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,-1932.7311,-1794.6277,32.6503))
      {
      SetPlayerCheckpoint(playerid,-1932.7311,-1794.6277,32.6503,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,-1997.9462,-2424.0452,31.6722))
      {
      SetPlayerCheckpoint(playerid,-1997.9462,-2424.0452,31.6722,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,-1574.5662,-2742.9358,49.5561))
      {
      SetPlayerCheckpoint(playerid,-1574.5662,-2742.9358,49.5561,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,2454.1226,-1419.8866,24.8431))
      {
      SetPlayerCheckpoint(playerid,2454.1226,-1419.8866,24.8431,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,2760.9805,-2459.2578,14.5597))
      {
      SetPlayerCheckpoint(playerid,2760.9805,-2459.2578,14.5597,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,810.8070,-602.3696,17.3526))
      {
      SetPlayerCheckpoint(playerid,810.8070,-602.3696,17.3526,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,-209.4572,-278.9285,2.4487))
      {
      SetPlayerCheckpoint(playerid,-209.4572,-278.9285,2.4487,7.0);
      }
      if(IsPlayerInRangeOfPoint(playerid, 900000000.0,-523.3458,2593.6199,54.4276))
      {
      SetPlayerCheckpoint(playerid,-523.3458,2593.6199,54.4276,7.0);
      }
Reply


Messages In This Thread
The closest checkpoint - by w3b - 19.12.2015, 16:55
Re: The closest checkpoint - by w3b - 19.12.2015, 17:32

Forum Jump:


Users browsing this thread: 1 Guest(s)