GetRed Posted February 20, 2021 Share Posted February 20, 2021 Hello there guys, i'm having an issue. So basically i'm trying to make a command which teleports the player to a specific location, facing towards an exact angle, if the player is in a vehicle, it teleports the vehicle to other coordinates, facing towards other angle. The problem there is the "heading" thing, i tried so many things to make the vehicle or the player always teleport in a specific angle but it didn't work. Can anyone help me? Here's the code: mp.events.addCommand('gotoa', (player) => { if (player.vehicle) player.vehicle.position = new mp.Vector3(-1033.1522216796875, -2729.705078125, 20.113100051879883, -117.61063385009766); else player.position = new mp.Vector3(-1037.6630859375, -2737.679443359375, 20.16929054260254, -30.945030212402344); }); Link to comment Share on other sites More sharing options...
7inage Posted February 20, 2021 Share Posted February 20, 2021 Let's start with the fact that Vector3 has only 3 coordinates. X, Y, Z let vector = new mp.Vector3(Number x, Number y, Number z) Now to how to set the rotation coordinates //Player player.heading = your value; //Vehicle vehicle.rotation = new mp.Vector3(0, 0, 90); Sources: https://wiki.rage.mp/index.php?title=Player::heading https://wiki.rage.mp/index.php?title=Vehicle::rotation Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now