Angle from postion to another
#1

Hello,

iґm searching a code to get the angle from a position to antoher postion. For example, iґm standing in front of the LSPD and will look at the LSPD building. So i will get the angle to look on the LSPD building by the 2 positions.
Reply
#2

https://sampwiki.blast.hk/wiki/GetPlayerFacingAngle
Reply
#3

Thanks Rudy_, but i need a code to get angle by 2 postions
Reply
#4

I don't understand? What do you mean ' by 2 positions' ?
Reply
#5

That should be enough

pawn Код:
new Float: Angle = -atan2(TARGET_X - PLAYER_X, TARGET_Y - PLAYER_Y);
SetPlayerFacingAngle(playerid, Angle);
Reply
#6

Very nice, it works.

Thank you Nero_3D
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)