person who's closest to checkpoint
#2

You should use a function to get the distance between two coords.
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));
}
Reply


Messages In This Thread
person who's closest to checkpoint - by swieberdevos - 12.06.2011, 17:21
Re: person who's closest to checkpoint - by Anzipane! - 12.06.2011, 17:42
Re: person who's closest to checkpoint - by swieberdevos - 13.06.2011, 12:43
Re: person who's closest to checkpoint - by Benjo - 13.06.2011, 14:28

Forum Jump:


Users browsing this thread: 1 Guest(s)