diff --git a/client/functions.lua b/client/functions.lua index c581286..36e96a0 100644 --- a/client/functions.lua +++ b/client/functions.lua @@ -141,9 +141,9 @@ end function QBCore.Functions.GetClosestPed(coords, ignoreList) local ped = PlayerPedId() if coords then - if type(coords) == 'table' then coords = vector3(coords.x, coords.y, coords.z) end + if type(coords) == 'table' then coords = vector3(coords.x, coords.y, coords.z) end else - coords = GetEntityCoords(ped) + coords = GetEntityCoords(ped) end local ignoreList = ignoreList or {} local peds = QBCore.Functions.GetPeds(ignoreList) @@ -164,9 +164,9 @@ end function QBCore.Functions.GetClosestPlayer(coords) local ped = PlayerPedId() if coords then - if type(coords) == 'table' then coords = vector3(coords.x, coords.y, coords.z) end + if type(coords) == 'table' then coords = vector3(coords.x, coords.y, coords.z) end else - coords = GetEntityCoords(ped) + coords = GetEntityCoords(ped) end local closestPlayers = QBCore.Functions.GetPlayersFromCoords(coords) local closestDistance = -1 @@ -189,9 +189,9 @@ function QBCore.Functions.GetPlayersFromCoords(coords, distance) local players = QBCore.Functions.GetPlayers() local ped = PlayerPedId() if coords then - if type(coords) == 'table' then coords = vector3(coords.x, coords.y, coords.z) end + if type(coords) == 'table' then coords = vector3(coords.x, coords.y, coords.z) end else - coords = GetEntityCoords(ped) + coords = GetEntityCoords(ped) end local distance = distance or 5 local closePlayers = {} @@ -212,9 +212,9 @@ function QBCore.Functions.GetClosestVehicle(coords) local closestDistance = -1 local closestVehicle = -1 if coords then - if type(coords) == 'table' then coords = vector3(coords.x, coords.y, coords.z) end + if type(coords) == 'table' then coords = vector3(coords.x, coords.y, coords.z) end else - coords = GetEntityCoords(ped) + coords = GetEntityCoords(ped) end for i=1, #vehicles, 1 do local vehicleCoords = GetEntityCoords(vehicles[i]) @@ -234,9 +234,9 @@ function QBCore.Functions.GetClosestObject(coords) local closestDistance = -1 local closestObject = -1 if coords then - if type(coords) == 'table' then coords = vector3(coords.x, coords.y, coords.z) end + if type(coords) == 'table' then coords = vector3(coords.x, coords.y, coords.z) end else - coords = GetEntityCoords(ped) + coords = GetEntityCoords(ped) end for i = 1, #objects, 1 do local objectCoords = GetEntityCoords(objects[i]) @@ -272,9 +272,9 @@ function QBCore.Functions.SpawnVehicle(model, cb, coords, isnetworked) local model = GetHashKey(model) local ped = PlayerPedId() if coords then - if type(coords) == 'table' then coords = vector3(coords.x, coords.y, coords.z) end + if type(coords) == 'table' then coords = vector3(coords.x, coords.y, coords.z) end else - coords = GetEntityCoords(ped) + coords = GetEntityCoords(ped) end local isnetworked = isnetworked or true if not IsModelInCdimage(model) then return end