Skip to content

Commit

Permalink
Update aim coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
oldnapalm committed Apr 16, 2024
1 parent bf21c29 commit fb94801
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Client/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -715,8 +715,13 @@ public static void SendPlayerData()

GTA.Math.Vector3 aimCoord = new GTA.Math.Vector3();
if (aiming || shooting)
aimCoord = ScreenRelToWorld(GameplayCamera.Position, GameplayCamera.Rotation,
new Vector2(0, 0));
{
var crosshair = World.GetCrosshairCoordinates();
if (crosshair.DidHit)
aimCoord = crosshair.HitPosition;
else
aimCoord = ScreenRelToWorld(GameplayCamera.Position, GameplayCamera.Rotation, new Vector2(0, 0));
}

var obj = new PedData();
obj.AimCoords = aimCoord.ToLVector();
Expand Down

0 comments on commit fb94801

Please sign in to comment.