Help with facing angle
#1

My player is at one point and i want them to face to another point.
How do i use SetPlayerFacingAngle to do this? Since its 0-360 degree angle i have no clue how to.
Is there anything like SetPlayerFacingToPoint(playerid, x, y, z); ?

I have a picture here to help you understand what i want
Reply
#2

Ok, first. Get to the postition you want the player to stand at. Do /rs. The last part ignore, use:
pawn Code:
SetPlayerPos(playerid,X,Y,Z);
Then find the direction you want the player to face, turn that direction. Do /rs again and use the last bit as this:

pawn Code:
SetPlayerFacingAngle(playerid,ANGLE);
Here's an example:

pawn Code:
1767.3073,-2024.1143,14.1494,222.3893
pawn Code:
SetPlayerPos(playerid,1767.3073,-2024.1143,14.1494);
SetPlayerFacingAngle(playerid,222.3893);
The SetPlayerFacingAngle is the very last part of /rs (raw save) which will save in your GTA San Andreas User Files.

Hope you understood
Reply
#3

Thanks for reply, but its not really what i need. I need somehow to calculate the facing angle from the current pos to another pos. /rs will ofc get me facing angle, but the script will constantly need the facing angle updated while player is on the move.
Reply
#4

I see what you mean, you want to teleport the player to a point and have them face at a specific point.

https://sampforum.blast.hk/showthread.php?tid=28664&page=3
Reply
#5

Thanks Pottus
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)