10.06.2011, 17:24
I bet there are easier ways to do it, however I've just written up a short code that should fullfill what you need..
(didn't test the code)
remember to replace the floats that I've used for cx and cy with your checkpoint's x and y coords
rst = the result as a float
(didn't test the code)
pawn Code:
new Float:cx, Float:cy, Float:x, Float:y, Float:rst, Float:px, Float:py, Float:pz;
cx = 1.00; cy = 152.31;
GetPlayerPos(playerid, px, py, pz);
cx = floatabs(cx);
cy = floatabs(cy);
px = floatabs(px);
py = floatabs(py);
x = cx - px; y = cy - py;
x = floatabs(x);
y = floatabs(y);
rst = floatsqroot((x*x) + (y*y));
rst = the result as a float