[HELP]Get nearest to farthest
#1

I got myself this script, out of another script but see this:
pawn Код:
getNearestPizzeria(Float:X1,Float:Y1,Float:Z1)
  {
    new index;
    new Float:distOld=9999.0;
    new Float:distNew=0.0;
    for (new i=0;i<cantidadPizzerias;i++)
      {
      distNew=floatsqroot(floatpower(floatabs(floatsub(Pizzerias[i][X],X1)),2)+floatpower(floatabs(floatsub(Pizzerias[i][Y],Y1)),2)+floatpower(floatabs(floatsub(Pizzerias[i][Z],Z1)),2));
      if    (distNew<distOld)
        {
        distOld=distNew;
        index=i;
        }
      }
    return index;
  }
Pizzeria = airport

But that doesn't matter.
What matters is there are 3 airports and if you enter a checkpoint at these you get money, now your first checkpoint is the nearest airport, so if you go stand on the runway in the checkpoint and keep starting/stopping the job, you get tons of money without doing anything, thats why i want you to ask me if you could give me a way te get the Farthest one and not the Nearest.

Could you help me please?
Thanks in advance!!
Reply


Messages In This Thread
[HELP]Get nearest to farthest - by WThieves - 15.06.2010, 19:30
Re: [HELP]Get nearest to farthest - by Jefff - 15.06.2010, 19:37
Re: [HELP]Get nearest to farthest - by WThieves - 15.06.2010, 20:13

Forum Jump:


Users browsing this thread: 1 Guest(s)