From 15a264c3c976f0ba2d84cc91bb2c17686120884e Mon Sep 17 00:00:00 2001 From: Hakos47 <76844995+hakos47@users.noreply.github.com> Date: Thu, 23 Mar 2023 12:24:30 +0100 Subject: [PATCH] GetGroundHash returns the hash of the terrain you are on. quite useful for planting scripts --- client/functions.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/functions.lua b/client/functions.lua index e9f2ca8..f235581 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -991,4 +991,11 @@ function QBCore.Functions.GetGroundZCoord(coords) print(coords) return coords end -end \ No newline at end of file +end + +function QBCore.Functions.GetGroundHash(entity) + local coords = GetEntityCoords(entity) + local num = StartShapeTestCapsule(coords.x,coords.y,coords.z+4,coords.x,coords.y,coords.z-2.0, 1,1,veh,7) + local arg1, arg2, arg3, arg4, arg5 = GetShapeTestResultEx(num) + return arg5 +end