15.06.2010, 19:30
I got myself this script, out of another script but see this:
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!!
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;
}
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!!