Get distance between 2 points.
#7

Quote:
Originally Posted by bigcomfycouch
Посмотреть сообщение
pawn Код:
stock GetDistance( Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2 )
{
    return floatround( floatsqroot( ( ( x1 - x2 ) * ( x1 - x2 ) ) + ( ( y1 - y2 ) * ( y1 - y2 ) ) + ( ( z1 - z2 ) * ( z1 - z2 ) ) ) ) );
}
Quote:
Originally Posted by -=SR=-
Посмотреть сообщение
It works for what I needed, thanks a lot.
The code is actually:
Код:
pawn Код:
stock GetDistance( Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2 ){    return floatround( floatsqroot( ( ( x1 - x2 ) * ( x1 - x2 ) ) + ( ( y1 - y2 ) * ( y1 - y2 ) ) + ( ( z1 - z2 ) * ( z1 - z2 ) ) )  );}
You had one too many ')'
Reply


Messages In This Thread
Get distance between 2 points. - by -=SR=- - 20.02.2011, 01:46
Re: Get distance between 2 points. - by bigcomfycouch - 20.02.2011, 01:51
Re: Get distance between 2 points. - by -=SR=- - 20.02.2011, 02:10
Re: Get distance between 2 points. - by -=SR=- - 23.02.2011, 16:03
Re: Get distance between 2 points. - by Stefan_Toretto - 07.03.2011, 18:53
Re: Get distance between 2 points. - by [DRD]Rodney - 04.09.2011, 21:26
Re: Get distance between 2 points. - by rt-2 - 02.03.2016, 05:59
Re: Get distance between 2 points. - by Sascha - 02.03.2016, 09:11
Re: Get distance between 2 points. - by rt-2 - 05.03.2016, 02:44
Re: Get distance between 2 points. - by AbyssMorgan - 05.03.2016, 06:18

Forum Jump:


Users browsing this thread: 1 Guest(s)