Bartje Posted March 29, 2020 Share Posted March 29, 2020 Hi, Is it possible to check the aiming status of a player? When you have a weapon like a 'tec-9' and you aim backwards, you will lose your aimcontrol and your player just aims up. Is it possible to check if the player is in this upwards aiming state? Take a look the image below to see what I mean. The second image is the state that I want to check. Thanks! Link to comment
The_GTA Posted March 29, 2020 Share Posted March 29, 2020 4 minutes ago, Bartje said: Hi, Is it possible to check the aiming status of a player? When you have a weapon like a 'tec-9' and you aim backwards, you will lose your aimcontrol and your player just aims up. Is it possible to check if the player is in this upwards aiming state? Take a look the image below to see what I mean. The second image is the state that I want to check. Thanks! I think you can use the bone positions of the player to check if his hand is pointing upwards. Does that suit your use case well enough? https://wiki.multitheftauto.com/wiki/GetPedBonePosition You should calculate the direction of the ped weapon arm and see if it reaches a certain angle in comparison to the ground plane I guess. Link to comment
Bartje Posted March 29, 2020 Author Share Posted March 29, 2020 I tried the bone position but it wasn't accurate enough. I used the player camera rotation and player rotation to get the angle. Thanks. Link to comment
The_GTA Posted March 29, 2020 Share Posted March 29, 2020 8 minutes ago, Bartje said: I tried the bone position but it wasn't accurate enough. I used the player camera rotation and player rotation to get the angle. Thanks. Good idea! Honestly I would prefer if there was a direct MTA function for checking this, but sometimes we have to create makeshift solutions like this which approximate the issue just right 1 Link to comment
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