Coordinates of the sight
#12

Quote:
Originally Posted by Pottus
View Post
Try this.
Fire A weapon
Get the origin / hitpoint of the shot
Use https://sampwiki.blast.hk/wiki/VectorSize
Subtract the result this from camera front vector GetPlayerCameraFrontVector(playerid, fVX, fVY, fVZ)

That should give you a constant vector you can add to GetPlayerCameraFrontVector(playerid, fVX, fVY, fVZ); to figure out where the shot came from. Once you have your constant then test it you might have to compensate for facing angle? Not sure test it out.
Thats basically what I did for GetPlayerCameraWeaponVector but it was inacurrate because I only tested it for targets infront / same height of the player
After the GetPlayerLastShotVectors update it was clear that the offset differ if you aim up or down, so I adjusted it but that version isn't available anymore because I deleted it from github without reuploading it because I thought this wasn't needed anymore

Anyways you need to get multiple offsets for different z position and approximate or interpolate it
Here the graphic from my thread for three different weapon types with bad / manual approximation


That version should be on one of my old drives but a reapproximation wouldn't hurt

The older versions can be found in some old scripts but these are inaccurate because they are based on same height targets, so they should be accurate from around -0.4 to 0.4 z front vector
First version with static offsets can be found here, second version with circular offset can be found here
Reply


Messages In This Thread
Coordinates of the sight - by nikjda - 25.03.2019, 21:57
Re: Coordinates of the sight - by nikjda - 25.03.2019, 22:00
Re: Coordinates of the sight - by nikjda - 26.03.2019, 21:33
Re: Coordinates of the sight - by Pottus - 26.03.2019, 23:17
Re: Coordinates of the sight - by nikjda - 27.03.2019, 12:11
Re: Coordinates of the sight - by nikjda - 27.03.2019, 23:24
Re: Coordinates of the sight - by Pottus - 28.03.2019, 01:46
Re: Coordinates of the sight - by nikjda - 28.03.2019, 17:48
Re: Coordinates of the sight - by nikjda - 28.03.2019, 17:58
Re: Coordinates of the sight - by nikjda - 30.03.2019, 23:11
Re: Coordinates of the sight - by Pottus - 31.03.2019, 17:50
Re: Coordinates of the sight - by Nero_3D - 31.03.2019, 21:36

Forum Jump:


Users browsing this thread: 1 Guest(s)