Jump to content

How to determine the direction of the player?


XtReLL

Recommended Posts

Good day, friends.

Please tell me if it is possible and how to determine the direction of the player.

In the documentation, I found only the definition of the camera direction(https://wiki.rage.mp/index.php?title=Camera::getDirection), but I would like to know how to determine where the player model is looking.

I attach the implementation of determining the direction of the camera.

client-side

let getDirection = function () {
  const camera = mp.cameras.new("gameplay");
  let position = camera.getDirection();
  console.log(position);
  mp.gui.chat.push(`Direction: X:${position.x} Y:${position.y} Z:${position.z}`);
}
mp.events.add('dir', getDirection)

 

 

server-side

mp.events.addCommand('dir', (player) => {
  player.call("dir");
});


 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...