[HELP] Is it possible to take angle from CP?
#1

hi there,

I'm using "yrace" fs for racing script. But i need first checkpoint's angle. I mean, angle will look to second cp (like white arrow in first cp), and i will teleport people to that checkpoint with correct angle. Is it possible?
Reply
#2

huh?huh?huh?
Reply
#3

You could just do the math yourself. You have the x and the y coordinate of the first and second checkpoint, just ****** for a way to find the angle between them. Either that, or you could just go in game and line your player close enough to it.
Reply
#4

Yes it is.

You have to calculate the angle between 2 points. (2 checkpoints better)
This is the formula:
Код:
atan((y2 - y1) / (x2 - x1))
Try if it works.
Reply
#5

Yes its possible to calculate so good like everything if you got the cords from both points

Ryder would be correct if there wouldnt be the different angle system in gta sa (0° is north)
Reply
#6

@ Ryder, Do you mean:

pawn Код:
new Float:angle;

angle = atan((y2 - y1) / (x2 - x1))
??
Reply
#7

Ryder, i think you can answer now, ur online..?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)