Distance between checkpoint and player on textdraw
#2

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)
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));
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
Reply


Messages In This Thread
Distance between checkpoint and player on textdraw - by UTvern - 10.06.2011, 15:02
Re: Distance between checkpoint and player on textdraw - by Sascha - 10.06.2011, 17:24

Forum Jump:


Users browsing this thread: 1 Guest(s)