12.06.2011, 17:42
You should use a function to get the distance between two coords.
Here's a simple one using the Pythagorean theorem:
Here's a simple one using the Pythagorean theorem:
pawn Код:
stock GetDistanceBetweenCoords(Float:x1, Float:y1, Float:x2, Float:y2)
{
return floatsqroot(floatpower(floatabs(floatsub(x2, x1)), 2) + floatpower(floatabs(floatsub(y2, y1)), 2));
}