31.03.2019, 21:36
Quote:
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. |
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