31.03.2019, 17:50
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.
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.