mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 03:01:31 +00:00
fix nearby players
This commit is contained in:
@@ -45,8 +45,8 @@ end
|
||||
---@param source vector3|number playerId or vector3 coordinates
|
||||
---@param maxDistance number
|
||||
---@param ignore table playerIds to ignore, where the key is playerId and value is true
|
||||
function ESX.OneSync.GetPlayersInArea(source, maxDistance, ignore, cb)
|
||||
cb(getNearbyPlayers(source, false, maxDistance, ignore))
|
||||
function ESX.OneSync.GetPlayersInArea(source, maxDistance, ignore)
|
||||
return getNearbyPlayers(source, false, maxDistance, ignore)
|
||||
end
|
||||
|
||||
---@param source vector3|number playerId or vector3 coordinates
|
||||
|
||||
@@ -749,15 +749,15 @@ ESX.RegisterServerCallback('esx_property:GetNearbyPlayers', function(source, cb,
|
||||
local Property = Properties[property]
|
||||
local Players = {}
|
||||
local xPlayer = ESX.GetPlayerFromId(source)
|
||||
ESX.OneSync.GetPlayersInArea(vector3(Property.Entrance.x, Property.Entrance.y, Property.Entrance.z), 5.0, function(NearbyPlayers)
|
||||
local NearbyPlayers = ESX.OneSync.GetPlayersInArea(vector3(Property.Entrance.x, Property.Entrance.y, Property.Entrance.z), 5.0)
|
||||
Wait(100)
|
||||
for k, v in pairs(NearbyPlayers) do
|
||||
local xTarget = ESX.GetPlayerFromId(v.id)
|
||||
---if xPlayer.identifier ~= xTarget.identifier then
|
||||
Players[#Players + 1] = {name = xTarget.getName(), source = xTarget.source}
|
||||
-- end
|
||||
if xPlayer.identifier ~= xTarget.identifier then
|
||||
Players[#Players + 1] = {name = xTarget.getName(), source = xTarget.source}
|
||||
end
|
||||
end
|
||||
cb(Players)
|
||||
end)
|
||||
end)
|
||||
|
||||
ESX.RegisterServerCallback('esx_property:GetPlayersWithKeys', function(source, cb, property)
|
||||
|
||||
Reference in New Issue
Block a user