Jump to content

[HELP] Player aiming status question


Recommended Posts

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.

Y8EgfWN.png

Thanks!

Link to post
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 post
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 ;) 

  • Like 1
Link to post

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...