Distance between checkpoint and player on textdraw
#1

Can someone please help me get the France between te displayed checkpoint and put on a textdraw
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)