• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] [Solved] Set player facing angle to the object
#1
Is there a function to set player facing angle to?object?





EDIT: https://www.burgershot.gg/showthread.php...5#pid11395
  Reply
#2
get object's position and set player's camera to look at it? you can try that
Using Pawn.CMD?

If you're doing so, this is the very first sign that you absolutely shouldn't utilize your all powerful P-Code knowledge in any of the scripting discussion topics.
  Reply
#3
Yes, SetPlayerFacingAngle.
  Reply
#4
I mean something else..

Never mind.
  Reply
#5
Are you looking for something like this: https://sampwiki.blast.hk/wiki/SetPlayerCameraLookAt



Update: I misread what you were looking to do.
lost venturas | coming soon
  Reply
#6
PHP Code:
stock SetPlayerFacingAngleToObject(playeridobjectid)

{

    new 
Float:x1Float:y1Float:z1;

    new 
Float:x2Float:y2Float:z2;

    

    
GetPlayerPos(playeridx1y1z1);

    
GetObjectPos(objectidx2y2z2);

    

    new 
Float:angle atan2(y2 y1x2 x1) - 90.0;

    

    
SetPlayerFacingAngle(playeridangle);


My nickname in-game is: [L]3O
  Reply


Forum Jump: