[HELP]Get nearest to farthest
#3

Quote:
Originally Posted by Jefff
pawn Код:
getNearestPizzeria(Float:X1,Float:Y1,Float:Z1)
{
    new index;
    new Float:distOld;
    new Float:distNew;
    for(new i; 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;
}
Thanks man! Didn't see that :P, just looked over it
You're the best!
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)