From 962cd4a997a04fd213b590cc5e99f88d095e503c Mon Sep 17 00:00:00 2001 From: BerkieBb <82737367+BerkieBb@users.noreply.github.com> Date: Mon, 21 Jun 2021 14:06:58 +0200 Subject: [PATCH] Add server function for getting entity coords --- server/functions.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/functions.lua b/server/functions.lua index a1390ab..f7dde8d 100644 --- a/server/functions.lua +++ b/server/functions.lua @@ -21,6 +21,17 @@ QBCore.Functions.ExecuteSql = function(wait, query, cb) return rtndata end +QBCore.Functions.GetEntityCoords = function(entity) + local coords = GetEntityCoords(entity, false) + local heading = GetEntityHeading(entity) + return { + x = coords.x, + y = coords.y, + z = coords.z, + a = heading + } +end + QBCore.Functions.GetIdentifier = function(source, idtype) local idtype = idtype ~=nil and idtype or QBConfig.IdentifierType for _, identifier in pairs(GetPlayerIdentifiers(source)) do