diff --git a/[core]/es_extended/server/classes/player.lua b/[core]/es_extended/server/classes/player.lua index 921db13b..5b36912b 100644 --- a/[core]/es_extended/server/classes/player.lua +++ b/[core]/es_extended/server/classes/player.lua @@ -80,20 +80,21 @@ function CreateExtendedPlayer(playerId, identifier, group, accounts, inventory, ---@param heading boolean ---@return vector3 | vector4 | table function self.getCoords(vector, heading) - local ped = _GetPlayerPed(self.source) - local coords = _GetEntityCoords(ped) + local ped = _GetPlayerPed(self.source) + local entityCoords = _GetEntityCoords(ped) + local entityHeading = _GetEntityHeading(ped) + + local coordinates = { x = entityCoords.x, y = entityCoords.y, z = entityCoords.z } - local coordinates if vector then - coordinates = (heading and vector4(coords.xyz, _GetEntityHeading(ped)) or coords) - else - coordinates = { x = coords.x, y = coords.y, z = coords.z } - if heading then - coordinates.heading = _GetEntityHeading(ped) + coordinates = (heading and vector4(entityCoords.xyz, entityHeading) or entityCoords) + else + if heading then + coordinates.heading = entityHeading end end - return coordinates + return coordinates end ---@param reason string