requested changes

This commit is contained in:
Dark3581
2023-01-03 18:18:54 -08:00
committed by GitHub
parent 30ac126949
commit 4551db736c

View File

@@ -11,16 +11,15 @@ function NDCore.Functions.GetCharacters()
end
function NDCore.Functions.GetPlayersFromCoords(coords, distance)
local players = GetActivePlayers()
local ped = PlayerPedId()
function NDCore.Functions.GetPlayersFromCoords(distance, coords)
if coords then
coords = type(coords) == 'table' and vec3(coords.x, coords.y, coords.z) or coords
else
coords = GetEntityCoords(ped)
coords = GetEntityCoords(PlayerPedId())
end
distance = distance or 5
local closePlayers = {}
local players = GetActivePlayers()
for _, player in pairs(players) do
local target = GetPlayerPed(player)
local targetCoords = GetEntityCoords(target)