Skip to content
This repository has been archived by the owner on Dec 25, 2022. It is now read-only.

Commit

Permalink
Checking horizontal distance only when moving props
Browse files Browse the repository at this point in the history
  • Loading branch information
razzie committed Jul 18, 2019
1 parent d9349f3 commit 1cb71d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Client/Props.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,13 @@ private static Task Update()
return Delay(1000);

var player = API.GetPlayerPed(-1);
var coords = API.GetEntityCoords(player, true);
var coords = (Vector2)API.GetEntityCoords(player, true);

var prop = _props[_props.Count - 1];
var pos = API.GetEntityCoords(prop, false);
var rotation = API.GetEntityRotation(prop, 0);

if (coords.DistanceToSquared(pos) < 100f)
if (Vector2.DistanceSquared(coords, (Vector2)pos) < 100f)
{
if (API.IsControlPressed(0, 172)) // up
API.SetEntityCoords(prop, pos.X, pos.Y, pos.Z + 0.01f, false, false, true, false);
Expand Down

0 comments on commit 1cb71d3

Please sign in to comment.