Jump to content

Is it possible to...


megaman54

Recommended Posts

hmm, you can create and move a corona marker to the point that player is aiming. but afair - player needs to click somewhere so you could get world position of click - which makes it impossible to move while moving mouse..

not sure about it anyway - maybe there is a chance to get aim world position.

Link to comment
hmm, you can create and move a corona marker to the point that player is aiming. but afair - player needs to click somewhere so you could get world position of click - which makes it impossible to move while moving mouse..

not sure about it anyway - maybe there is a chance to get aim world position.

getWorldFromScreenPosition and processLineOfSight can be used to get world position without clicking.

Link to comment

First thing that comes into my mind is combining the position of a player's bones with LineOfSight.

Detailed: A gun is just an object that is attached to one of the bones of a player (the hand, in this case). If you know the position of the elbow of that arm ánd the hand, you can use those two positions to calculate a line as an extension of the line that the positions of the elbow and hand create, directed from the elbow to the hand. If you extend that line by, for example, 10 meters and use the position 10 meters "in front of the hand", you could process a line of sight to check if it hits something. If it does, move the marker to that position.

If you repeat this calculation on onClientPreRender, this might work. Again, it's just an idea: this is how I would try it.

[EEEEEEEEDIEET] Here's a nice drawing btw:

flashlight.jpg

Hope you get what I mean. Useful links:

https://wiki.multitheftauto.com/wiki/GetPedBonePosition (to get the two positions)

https://wiki.multitheftauto.com/wiki/ProcessLineOfSight (to get a hit position)

Link to comment

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